@@ -173,11 +173,11 @@ interface llm {
173173 /// A sequence where the model stops generating tokens
174174 stop-sequences : option <list <string >>,
175175 /// List of available tools
176- tools : list <tool-definition >,
176+ tools : option < list <tool-definition > >,
177177 /// Tool choice policy
178178 tool-choice : option <string >,
179179 /// Additional LLM provider specific key-value pairs
180- provider-options : list <kv >,
180+ provider-options : option < list <kv > >,
181181 }
182182
183183 // --- Usage / Metadata ---
@@ -286,33 +286,6 @@ interface llm {
286286 events : list <event >,
287287 config : config ,
288288 ) -> chat-stream ;
289-
290- // --- Chat session ---
291-
292- /// Chat session is a simple wrapper on top of events to help with maintaining chat history
293- resource chat-session {
294- /// Create new session with the provided config
295- constructor (config : config );
296-
297- /// Add a single user message to the chat events
298- add-message : func (message : message );
299- /// Add multiple user messages to the chat events
300- add-messages : func (messages : list <message >);
301- /// Add a single tool result to the chat events
302- add-tool-result : func (tool-result : tool-result );
303- /// Add multiple tool results to the chat events
304- add-tool-results : func (tool-results : list <tool-result >);
305-
306- /// Observe all events in the session
307- get-chat-events : func () -> list <event >;
308- // Replace all events in the session, which allows e.g. compacting them
309- set-chat-events : func (events : list <event >);
310-
311- /// Send the full accumulated chat events, responses are automatically added to the session chat events
312- send : func () -> result <response , error >;
313- /// Like Send, but streams responses
314- %stream : func () -> chat-stream ;
315- }
316289}
317290
318291world llm-library {
0 commit comments