diff --git a/src/BaselineOfPharoOllama/BaselineOfPharoOllama.class.st b/src/BaselineOfPharoOllama/BaselineOfPharoOllama.class.st index c80e963..98618a1 100644 --- a/src/BaselineOfPharoOllama/BaselineOfPharoOllama.class.st +++ b/src/BaselineOfPharoOllama/BaselineOfPharoOllama.class.st @@ -21,12 +21,13 @@ Internal Representation and Key Implementation Points. Implementation Points " Class { - #name : #BaselineOfPharoOllama, - #superclass : #BaselineOf, - #category : #BaselineOfPharoOllama + #name : 'BaselineOfPharoOllama', + #superclass : 'BaselineOf', + #category : 'BaselineOfPharoOllama', + #package : 'BaselineOfPharoOllama' } -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfPharoOllama >> baseline: spec [ @@ -36,7 +37,7 @@ BaselineOfPharoOllama >> baseline: spec [ self defineGroups: spec ] ] -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfPharoOllama >> defineDependencies: spec [ spec @@ -44,14 +45,15 @@ BaselineOfPharoOllama >> defineDependencies: spec [ with: [ spec repository: 'github://svenvc/NeoJSON/repository' ] ] -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfPharoOllama >> defineGroups: spec [ ] -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfPharoOllama >> definePackages: spec [ spec package: 'Pharo-Ollama' with: [ spec requires: #( 'NeoJSON' ) ]. + spec package: 'Pharo-Ollama-Tests' with: [ spec requires: #( 'Pharo-Ollama' ) ]. spec for: #'pharo10.x' do: [ spec diff --git a/src/BaselineOfPharoOllama/package.st b/src/BaselineOfPharoOllama/package.st index 91e004f..9750c3e 100644 --- a/src/BaselineOfPharoOllama/package.st +++ b/src/BaselineOfPharoOllama/package.st @@ -1 +1 @@ -Package { #name : #BaselineOfPharoOllama } +Package { #name : 'BaselineOfPharoOllama' } diff --git a/src/Pharo-Ollama-Tests/OllamaAPITest.class.st b/src/Pharo-Ollama-Tests/OllamaAPITest.class.st new file mode 100644 index 0000000..52706fa --- /dev/null +++ b/src/Pharo-Ollama-Tests/OllamaAPITest.class.st @@ -0,0 +1,24 @@ +" +An OllamaAPITest is a test class for testing the behavior of OllamaAPI +" +Class { + #name : 'OllamaAPITest', + #superclass : 'TestCase', + #instVars : [ + 'ollama' + ], + #category : 'Pharo-Ollama-Tests', + #package : 'Pharo-Ollama-Tests' +} + +{ #category : 'running' } +OllamaAPITest >> setUp [ + super setUp. + ollama := OllamaAPI new. +] + +{ #category : 'running' } +OllamaAPITest >> testOllamaAPIHasDefaultModelInitialized [ + + self assert: (ollama model isKindOf: OModel) +] diff --git a/src/Pharo-Ollama-Tests/package.st b/src/Pharo-Ollama-Tests/package.st new file mode 100644 index 0000000..52ef5f2 --- /dev/null +++ b/src/Pharo-Ollama-Tests/package.st @@ -0,0 +1 @@ +Package { #name : 'Pharo-Ollama-Tests' } diff --git a/src/Pharo-Ollama/OCodeLlamaModel.class.st b/src/Pharo-Ollama/OCodeLlamaModel.class.st index 416cb60..ce672fd 100644 --- a/src/Pharo-Ollama/OCodeLlamaModel.class.st +++ b/src/Pharo-Ollama/OCodeLlamaModel.class.st @@ -41,6 +41,15 @@ OCodeLlamaModel class >> code7b [ yourself ] +{ #category : 'accessing' } +OCodeLlamaModel class >> codeLlama7binstructq3KS [ + + + ^ self new + tag: '7b-instruct-q3_K_S'; + yourself +] + { #category : 'accessing' } OCodeLlamaModel class >> instruct7b [ diff --git a/src/Pharo-Ollama/OPhi3Model.class.st b/src/Pharo-Ollama/OPhi3Model.class.st new file mode 100644 index 0000000..b69e9c2 --- /dev/null +++ b/src/Pharo-Ollama/OPhi3Model.class.st @@ -0,0 +1,30 @@ +Class { + #name : 'OPhi3Model', + #superclass : 'OModel', + #category : 'Pharo-Ollama', + #package : 'Pharo-Ollama' +} + +{ #category : 'accessing' } +OPhi3Model class >> medium [ + + + ^ self new + tag: 'medium'; + yourself +] + +{ #category : 'accessing' } +OPhi3Model class >> mini [ + + + ^ self new + tag: 'mini'; + yourself +] + +{ #category : 'accessing' } +OPhi3Model >> name [ + + ^ 'phi3' +] diff --git a/src/Pharo-Ollama/OllamaAPI.class.st b/src/Pharo-Ollama/OllamaAPI.class.st index b9ca358..b628fea 100644 --- a/src/Pharo-Ollama/OllamaAPI.class.st +++ b/src/Pharo-Ollama/OllamaAPI.class.st @@ -40,7 +40,7 @@ OllamaAPI class >> ollamaSettings: aBuilder [ with: [ (aBuilder pickOne: #defaultModel) order: -100000; - label: 'HuggingFace Default model'; + label: 'Ollama Default model'; target: self; default: OCodeLlamaModel class >> #b7; domainValues: @@ -122,7 +122,10 @@ OllamaAPI >> initialize [ super initialize. host := '127.0.0.1'. port := 11434. - model := self class defaultModel. + model := self class defaultModel + valueWithReceiver: + self class defaultModel methodClass instanceSide + arguments: { }. stream := false ]