File tree Expand file tree Collapse file tree 3 files changed +52
-5
lines changed Expand file tree Collapse file tree 3 files changed +52
-5
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ LLMAPI class >> llmSettingOn: aBuilder [
7373 < systemsettings>
7474 (aBuilder group: #LLMAPI )
7575 parent: #tools ;
76- name: ' LLM API ' ;
76+ name: self settingName ;
7777 with: [
7878 (aBuilder setting: #apiKey )
7979 order: - 100000 ;
@@ -112,6 +112,12 @@ LLMAPI class >> port: aPortNumber [
112112 port := aPortNumber
113113]
114114
115+ { #category : ' as yet unclassified' }
116+ LLMAPI class >> settingName [
117+
118+ ^ ' LLM API'
119+ ]
120+
115121{ #category : ' accessing' }
116122LLMAPI >> apiKey [
117123
Original file line number Diff line number Diff line change @@ -23,10 +23,48 @@ result := api performRequest.
2323Class {
2424 #name : ' LLMAPIChat' ,
2525 #superclass : ' LLMAPI' ,
26+ #classInstVars : [
27+ ' chatModel'
28+ ],
2629 #category : ' LLM-API' ,
2730 #package : ' LLM-API'
2831}
2932
33+ { #category : ' accessing' }
34+ LLMAPIChat class >> chatModel [
35+
36+ ^ chatModel
37+ ]
38+
39+ { #category : ' accessing' }
40+ LLMAPIChat class >> chatModel: anObject [
41+
42+ chatModel := anObject
43+ ]
44+
45+ { #category : ' as yet unclassified' }
46+ LLMAPIChat class >> llmSettingOn: aBuilder [
47+
48+ < systemsettings>
49+ (aBuilder group: #LLMChat )
50+ parent: super settingName;
51+ name: ' LLM Chat' ;
52+ with: [
53+ (aBuilder setting: #chatModel )
54+ order: 0 ;
55+ label: ' LLM Chat default model' ;
56+ target: self ;
57+ default: ' devstral:latest' ;
58+ ghostHelp: ' devstral:latest' ]
59+ ]
60+
61+ { #category : ' initialization' }
62+ LLMAPIChat >> initialize [
63+
64+ super initialize.
65+ self payload model: self class chatModel
66+ ]
67+
3068{ #category : ' accessing' }
3169LLMAPIChat >> path [
3270 ^ ' v1/chat/completions'
Original file line number Diff line number Diff line change @@ -17,19 +17,16 @@ Class {
1717 #package : ' LLM-Spec'
1818}
1919
20- { #category : ' initialization ' }
20+ { #category : ' api ' }
2121LLMAPISpecChat >> askLLM [
2222
2323 | api result resultContent |
2424 history addMessage:
2525 (LLMAPIChatObjectMessage role: ' user' content: inputField text).
2626 api := LLMAPI chat.
27- api host: ' api.mistral.ai' .
2827 api payload
2928 temperature: 0.5 ;
30- model: ' mistral-small-latest' ;
3129 top_p: 1 ;
32- max_tokens: 250 ;
3330 tools:
3431 (LLMAPIChatObjectTool allSubclasses collect: [ :clazz | clazz new ]);
3532 messages: history model.
@@ -61,6 +58,12 @@ LLMAPISpecChat >> defaultLayout [
6158 yourself
6259]
6360
61+ { #category : ' accessing' }
62+ LLMAPISpecChat >> history [
63+
64+ ^ history
65+ ]
66+
6467{ #category : ' initialization' }
6568LLMAPISpecChat >> initializePresenters [
6669
You can’t perform that action at this time.
0 commit comments