-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to make Ollama work in Gemstone [feenkcom/gtoolkit#4322]
- Loading branch information
Showing
8 changed files
with
75 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ RwSimpleProjectLoadComponentV2 { | |
'Gt4Ollama' | ||
], | ||
#comment : '' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ RwPlatformNestedProjectLoadComponentV2 { | |
'Gt4Llm-Gemstone' | ||
], | ||
#comment : '' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ RwProjectSpecificationV2 { | |
#packageFormat : 'tonel', | ||
#packageConvention : 'RowanHybrid', | ||
#comment : '' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Extension { #name : 'ExecBlock' } | ||
|
||
{ #category : '*Gt4Llm-Gemstone' } | ||
ExecBlock >> doWhileTrue: aBlock [ | ||
self value. | ||
^ aBlock whileTrue: self | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,76 @@ | ||
Class { | ||
#name : #GtOllamaCompleteChatAPIClient, | ||
#superclass : #GtLlmEndpointClient, | ||
#name : 'GtOllamaCompleteChatAPIClient', | ||
#superclass : 'GtLlmEndpointClient', | ||
#instVars : [ | ||
'messages', | ||
'model', | ||
'format', | ||
'tools' | ||
], | ||
#category : #Gt4Ollama | ||
#category : 'Gt4Ollama' | ||
} | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> entity [ | ||
| entity | | ||
entity := {'stream' -> false. | ||
'model' -> self model. | ||
'messages' -> (self messages collect: #serialize)} asDictionary. | ||
entity := {('stream' -> false). | ||
('model' -> self model). | ||
('messages' -> (self messages collect: [ :aMessage | aMessage serialize ]))} | ||
asDictionary. | ||
|
||
self format ifNotNil: [ entity at: 'format' put: self format ]. | ||
self tools | ||
ifNotNil: [ entity at: 'tools' put: (self tools collect: #serialize) ]. | ||
ifNotNil: [ entity at: 'tools' put: (self tools collect: #'serialize') ]. | ||
|
||
^ entity | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> format [ | ||
^ format | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> format: anObject [ | ||
format := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> messages [ | ||
^ messages | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> messages: anObject [ | ||
messages := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> model [ | ||
^ model | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> model: anObject [ | ||
model := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> request [ | ||
^ self client post: '/chat' withEntity: self entity | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> serializationClass [ | ||
^ GtOllamaThreadMessage | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> tools [ | ||
^ tools | ||
] | ||
|
||
{ #category : #accessing } | ||
{ #category : 'accessing' } | ||
GtOllamaCompleteChatAPIClient >> tools: anObject [ | ||
tools := anObject | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
#format : 'tonel', | ||
#convention : 'RowanHybrid' | ||
} |