File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,16 @@ Class {
1818 #package : ' LLM-Spec'
1919}
2020
21+ { #category : ' examples' }
22+ LLMAPISpec class >> menuCommandOn: aBuilder [
23+
24+ < worldMenu>
25+ (aBuilder item: #' Open LLM Chat' )
26+ order: 1000 ;
27+ action: [ self open ];
28+ help: ' Open an LLM Chat wincow'
29+ ]
30+
2131{ #category : ' examples' }
2232LLMAPISpec class >> open [
2333 < example>
Original file line number Diff line number Diff line change @@ -25,14 +25,24 @@ LLMAPISpecChatBubble class >> from: aMessage [
2525 yourself
2626]
2727
28+ { #category : ' initialization' }
29+ LLMAPISpecChatBubble >> contentArea [
30+
31+ ^ contentArea
32+ ]
33+
2834{ #category : ' layout' }
2935LLMAPISpecChatBubble >> defaultLayout [
3036
3137 ^ SpBoxLayout newTopToBottom
38+ beNotHomogeneous;
3239 add: self model role expand: false ;
33- " add: roleText expand: false;" add: contentArea
34- withConstraints: [ :constraints |
35- constraints height: (self class inputTextHeight) * 4 ];
40+ add: contentArea withConstraints: [ :constraints |
41+ self contentArea build.
42+ constraints
43+ height:
44+ ((self contentArea text lineHeightsWrappingAtWidth:
45+ self extent x) sum) + (self class inputTextHeight * 1.5 ) ];
3646 yourself
3747]
3848
Original file line number Diff line number Diff line change @@ -30,21 +30,25 @@ LLMAPISpecChatHistory >> addMessage: aMessage [
3030
3131 self model add: aMessage.
3232 aMessage role = ' system' ifFalse: [
33- panel add : (LLMAPISpecChatBubble from: aMessage) ]
33+ panel addPresenter : (LLMAPISpecChatBubble from: aMessage) ]
3434]
3535
3636{ #category : ' layout' }
3737LLMAPISpecChatHistory >> defaultLayout [
3838
39- ^ SpScrollableLayout with: panel
39+ | scrollPane |
40+ scrollPane := SpBoxLayout new
41+ add: panel;
42+ yourself .
43+ ^ scrollPane
4044]
4145
4246{ #category : ' initialization' }
4347LLMAPISpecChatHistory >> initializePresenters [
4448
45- panel := SpBoxLayout newTopToBottom .
49+ panel := SpComponentListPresenter new .
4650
4751 self model do: [ :message |
48- message role = ' system' ifFalse: [
49- panel add : (LLMAPISpecChatBubble from: message) expand: true ] ]
52+ message role = ' system' ifFalse: [
53+ panel addPresenter : (LLMAPISpecChatBubble from: message) ] ]
5054]
You can’t perform that action at this time.
0 commit comments