From b1d9fac8175697d4bdc61d638b28a20af05e714a Mon Sep 17 00:00:00 2001 From: Veit Heller Date: Fri, 7 Mar 2025 11:13:11 +0100 Subject: [PATCH] Move chat examples into gt4llm common package [feenkcom/gtoolkit#4322] --- .../GtLlmChatExamples.class.st | 41 +---------------- .../GtLlmChatExamples.extension.st | 18 ++++++++ src/Gt4Llm/GtLlmChatExamples.class.st | 44 +++++++++++++++++++ 3 files changed, 63 insertions(+), 40 deletions(-) create mode 100644 src/Gt4Llm-GToolkit/GtLlmChatExamples.extension.st create mode 100644 src/Gt4Llm/GtLlmChatExamples.class.st diff --git a/src/Gt4Llm-GToolkit/GtLlmChatExamples.class.st b/src/Gt4Llm-GToolkit/GtLlmChatExamples.class.st index a8b8bae..67e25d8 100644 --- a/src/Gt4Llm-GToolkit/GtLlmChatExamples.class.st +++ b/src/Gt4Llm-GToolkit/GtLlmChatExamples.class.st @@ -4,19 +4,7 @@ Class { #category : #'Gt4Llm-GToolkit' } -{ #category : #'as yet unclassified' } -GtLlmChatExamples >> basicChat [ - - | 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 [ | chat ran | @@ -32,30 +20,3 @@ GtLlmChatExamples >> chatFuture [ ^ chat ] - -{ #category : #'as yet unclassified' } -GtLlmChatExamples >> chatWithMessages [ - - | 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 [ - - | chat | - chat := self basicChat. - - chat provider: GtLlmNullProvider new. - - self assert: chat status isDone. - - ^ chat -] diff --git a/src/Gt4Llm-GToolkit/GtLlmChatExamples.extension.st b/src/Gt4Llm-GToolkit/GtLlmChatExamples.extension.st new file mode 100644 index 0000000..0346de7 --- /dev/null +++ b/src/Gt4Llm-GToolkit/GtLlmChatExamples.extension.st @@ -0,0 +1,18 @@ +Extension { #name : #GtLlmChatExamples } + +{ #category : #'*Gt4Llm-GToolkit' } +GtLlmChatExamples >> chatFuture [ + + | chat ran | + chat := self basicChat. + + chat provider: GtLlmNullProvider new. + + ran := false. + + (chat whenReadyFuture then: [ran := true]) wait. + + self assert: ran. + + ^ chat +] diff --git a/src/Gt4Llm/GtLlmChatExamples.class.st b/src/Gt4Llm/GtLlmChatExamples.class.st new file mode 100644 index 0000000..9dafd61 --- /dev/null +++ b/src/Gt4Llm/GtLlmChatExamples.class.st @@ -0,0 +1,44 @@ +Class { + #name : #GtLlmChatExamples, + #superclass : #Object, + #category : #Gt4Llm +} + +{ #category : #'as yet unclassified' } +GtLlmChatExamples >> basicChat [ + + | chat | + chat := GtLlmChat new. + + self assert: chat messages size equals: 0. + self assert: chat status isDone not. + + ^ chat +] + +{ #category : #'as yet unclassified' } +GtLlmChatExamples >> chatWithMessages [ + + | 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 [ + + | chat | + chat := self basicChat. + + chat provider: GtLlmNullProvider new. + + self assert: chat status isDone. + + ^ chat +]