Skip to content

Commit

Permalink
Move initializeMethod methods into gemstone-specific package [feenkco…
Browse files Browse the repository at this point in the history
  • Loading branch information
hellerve committed Mar 6, 2025
1 parent 7f655e2 commit abdc62d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 78 deletions.
6 changes: 6 additions & 0 deletions src/Gt4Llm-Gemstone/GtLlmTutorAction.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : 'GtLlmTutorAction' }

{ #category : '*Gt4Llm-Gemstone' }
GtLlmTutorAction >> initializeMethod [
^ nil
]
6 changes: 6 additions & 0 deletions src/Gt4Llm-Gemstone/GtLlmTutorFormatDescription.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : 'GtLlmTutorFormatDescription' }

{ #category : '*Gt4Llm-Gemstone' }
GtLlmTutorFormatDescription >> initializeMethod [
^ nil
]
81 changes: 38 additions & 43 deletions src/Gt4Llm/GtLlmTutorAction.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #GtLlmTutorAction,
#superclass : #Object,
#name : 'GtLlmTutorAction',
#superclass : 'Object',
#instVars : [
'name',
'examples',
Expand All @@ -14,17 +14,17 @@ Class {
#category : 'Gt4Llm'
}

{ #category : #other }
{ #category : 'other' }
GtLlmTutorAction class >> new [
^ self basicNew initialize
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> addExample: anExample [
examples add: (anExample action: self)
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> asExpressionSource [
^ self class name asString
, ' new
Expand All @@ -40,7 +40,7 @@ GtLlmTutorAction >> asExpressionSource [
' join: (self examples collect: #asExpressionSource)) , '}'
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> asInstructionPiece [
^ GtLlmInstructionSection new
source: self;
Expand All @@ -53,7 +53,7 @@ GtLlmTutorAction >> asInstructionPiece [
body: (GtLlmInstructionComposite new items: self examples)))
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> asMethodSource [
| methodSource |
methodSource := (self definingMethod
Expand All @@ -65,68 +65,68 @@ GtLlmTutorAction >> asMethodSource [
^ methodSource
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> defaultPriority [
^ 10
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> definingMethod [
^ definingMethod
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> definingMethod: aMethod [
definingMethod := nil
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> description [
^ description
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> description: anObject [
description := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> examples [
^ examples
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> examples: anObject [
examples := anObject asOrderedCollection.

examples do: [ :anExample | anExample action: self ]
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> format [
^ format
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> format: anObject [
format := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> formatReferences [
^ (self examples flatCollect: #formatReferences as: Set)
sorted: [ :a :b | a priority < b priority ]
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> gtDescriptionFor: aView [
<gtView>
^ aView textEditor
title: 'Description';
text: [ self description ]
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> gtExamplesFor: aView [
<gtView>
^ aView columnedList
Expand All @@ -136,7 +136,7 @@ GtLlmTutorAction >> gtExamplesFor: aView [
column: 'Output' text: #outputJson
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> gtInputFormatReferencesFor: aView [
<gtView>
^ aView columnedList
Expand All @@ -147,7 +147,7 @@ GtLlmTutorAction >> gtInputFormatReferencesFor: aView [
column: 'Format' text: #format
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> gtInstructionFor: aView [
<gtView>
^ aView forward
Expand All @@ -157,7 +157,7 @@ GtLlmTutorAction >> gtInstructionFor: aView [
view: #gtInstructionFor:
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> gtOutputFormatReferencesFor: aView [
<gtView>
^ aView columnedList
Expand All @@ -168,12 +168,12 @@ GtLlmTutorAction >> gtOutputFormatReferencesFor: aView [
column: 'Format' text: #format
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> hasArgument [
^ format formatCount > 0
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> initialize [
super initialize.

Expand All @@ -185,40 +185,35 @@ GtLlmTutorAction >> initialize [
definingMethod := self initializeMethod
]

{ #category : #accessing }
GtLlmTutorAction >> initializeMethod [
^ nil
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> inputReferences [
^ (self examples flatCollect: #inputReferences as: Set)
sorted: [ :a :b | a priority < b priority ]
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> name [
^ name
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> name: anObject [
name := anObject.
self format isEmptyOrNil ifTrue: [ self format: name ]
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> onTutorChanged [
self examples do: [ :anExample | anExample verify resolveReferences ]
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> outputReferences [
^ (self examples flatCollect: #outputReferences as: Set)
sorted: [ :a :b | a priority < b priority ]
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> persist [
| methodSource |
methodSource := self asMethodSource.
Expand All @@ -229,17 +224,17 @@ GtLlmTutorAction >> persist [
>> self definingMethod selector
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> pipeline [
^ pipeline
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> pipeline: anObject [
pipeline := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> printOn: aStream [
super printOn: aStream.

Expand All @@ -249,27 +244,27 @@ GtLlmTutorAction >> printOn: aStream [
nextPut: $)
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> priority [
^ priority
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> priority: anObject [
priority := anObject
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
GtLlmTutorAction >> removeFromSystem [
self definingMethod ifNotNil: [ :aMethod | aMethod removeFromSystem ]
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> tutor [
^ tutor
]

{ #category : #accessing }
{ #category : 'accessing' }
GtLlmTutorAction >> tutor: anObject [
tutor := anObject.

Expand Down
Loading

0 comments on commit abdc62d

Please sign in to comment.