Moldable Chat: Keeping track of multiple chats

To keep track of existing chats, you can register them in a global registry. GtL Object << #GtL slots: {}; tag: 'Core'; package: 'Gt4LlmCore' offers a fluent interface for doing just that.

Instead of writing:

GtLChat new
  

you can simply use:

GtL chat
  

Another convenient constructor is GtL>>#gt gt ^ GtLChatRegistry current newGtChat , which creates a default chat suitable for typical Glamorous Toolkit programming tasks.

The defaults are useful, but you might still want to specialize them. For example, in the chat below we start from a default GT chat, then extend it with an explanation and a response format for parsing a given string. In this case, we explicitly ask it to execute the code before proposing a solution, which should encourage the LLM to use the code evaluation tool:

c := GtL gt
		gtPageExplanation: 'Parsing with PetitParser2';
		addResponseFormatForMagrite: GtLPharoScript named: 'PharoScript';
		sendMarkdown: 'Create a script with a PetitParser2 parser for this ripgrep output format:
		
```console
./some/path/to/file.txt:43:1232:Bla
```

Try the script and ensure it works before proposing it.'
  

You can see the currently registered chats by inspecting the GtLChatRegistry Object << #GtLChatRegistry slots: { #announcer . #chats }; sharedVariables: { #Current }; package: 'Gt4LlmCore' singleton:

GtLChatRegistry current
  

The registry is also available from the top menu bar.