Skip to content

Commit

Permalink
Move chat examples into gt4llm common package [feenkcom/gtoolkit#4322]
Browse files Browse the repository at this point in the history
  • Loading branch information
hellerve committed Mar 7, 2025
1 parent 36a88b3 commit b1d9fac
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 40 deletions.
41 changes: 1 addition & 40 deletions src/Gt4Llm-GToolkit/GtLlmChatExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@ Class {
#category : #'Gt4Llm-GToolkit'
}

{ #category : #'as yet unclassified' }
GtLlmChatExamples >> basicChat [
<gtExample>
| chat |
chat := GtLlmChat new.

self assert: chat messages size equals: 0.
self assert: chat status isDone not.

^ chat
]

{ #category : #'as yet unclassified' }
{ #category : #'*Gt4Llm-GToolkit' }
GtLlmChatExamples >> chatFuture [
<gtExample>
| chat ran |
Expand All @@ -32,30 +20,3 @@ GtLlmChatExamples >> chatFuture [

^ chat
]

{ #category : #'as yet unclassified' }
GtLlmChatExamples >> chatWithMessages [
<gtExample>
| chat |
chat := self chatWithProvider.

chat sendMessage: 'Hi!'.

self assert: chat status isDone.
self assert: chat messages size equals: 1.

^ chat
]

{ #category : #'as yet unclassified' }
GtLlmChatExamples >> chatWithProvider [
<gtExample>
| chat |
chat := self basicChat.

chat provider: GtLlmNullProvider new.

self assert: chat status isDone.

^ chat
]
18 changes: 18 additions & 0 deletions src/Gt4Llm-GToolkit/GtLlmChatExamples.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #GtLlmChatExamples }

{ #category : #'*Gt4Llm-GToolkit' }
GtLlmChatExamples >> chatFuture [
<gtExample>
| chat ran |
chat := self basicChat.

chat provider: GtLlmNullProvider new.

ran := false.

(chat whenReadyFuture then: [ran := true]) wait.

self assert: ran.

^ chat
]
44 changes: 44 additions & 0 deletions src/Gt4Llm/GtLlmChatExamples.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Class {
#name : #GtLlmChatExamples,
#superclass : #Object,
#category : #Gt4Llm
}

{ #category : #'as yet unclassified' }
GtLlmChatExamples >> basicChat [
<gtExample>
| chat |
chat := GtLlmChat new.

self assert: chat messages size equals: 0.
self assert: chat status isDone not.

^ chat
]

{ #category : #'as yet unclassified' }
GtLlmChatExamples >> chatWithMessages [
<gtExample>
| chat |
chat := self chatWithProvider.

chat sendMessage: 'Hi!'.

self assert: chat status isDone.
self assert: chat messages size equals: 1.

^ chat
]

{ #category : #'as yet unclassified' }
GtLlmChatExamples >> chatWithProvider [
<gtExample>
| chat |
chat := self basicChat.

chat provider: GtLlmNullProvider new.

self assert: chat status isDone.

^ chat
]

0 comments on commit b1d9fac

Please sign in to comment.