Foundry.LlmConversation¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Foundry.LlmConversation(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Abstract base class for managing conversations with large language models.
Foundry.LlmConversationprovides the core interface for interacting with language models including message management, tool integration, and conversation state tracking. Concrete implementations handle specific LLM providers and maintain conversation context for development assistance.- add_context(context)¶
- Parameters:
context (
str) –- Returns:
a [class`Dex`.Future] that resolves to any value or rejects with error.
- Return type:
Adds context to the conversation.
Generally this applies to the conversation right after the system prompt.
- call(call)¶
- Parameters:
call (
Foundry.LlmToolCall) – a [class`Foundry`.LlmToolCall]- Returns:
a [class`Dex`.Future] that resolves to a [class`Foundry`.LlmMessage] or rejects with error.
- Return type:
- dup_tools()¶
- Returns:
a [iface`Gio`.ListModel] of [class`Foundry`.LlmTool]
- Return type:
Lists tools made available to the conversation.
- list_history()¶
- Returns:
a [iface`Gio`.ListModel] of [class`Foundry`.LlmMessage].
- Return type:
List the available history of the conversation.
- reset()¶
Reset the conversation to the initial state.
- send_message(role, message)¶
- Parameters:
- Returns:
a [class`Dex`.Future] that resolves to any value or rejects with error.
- Return type:
The role should generally be something like “system”, “user”, “assistant”, or “tool”.
- send_messages(roles, messages)¶
- Parameters:
- Returns:
a [class`Dex`.Future] that resolves to any value or rejects with error.
- Return type:
Send multiple messages together.
The length of roles must be the same as messages.
- set_tools(tools)¶
- Parameters:
tools (
Gio.ListModel) – a list model of [class`Foundry`.LlmTool]
Set the tools that are allowed to be used by the model.
- do_add_context(context) virtual¶
- Parameters:
context (
str) –- Returns:
a [class`Dex`.Future] that resolves to any value or rejects with error.
- Return type:
Adds context to the conversation.
Generally this applies to the conversation right after the system prompt.
- do_call(call) virtual¶
- Parameters:
call (
Foundry.LlmToolCall) – a [class`Foundry`.LlmToolCall]- Returns:
a [class`Dex`.Future] that resolves to a [class`Foundry`.LlmMessage] or rejects with error.
- Return type:
- do_list_history() virtual¶
- Returns:
a [iface`Gio`.ListModel] of [class`Foundry`.LlmMessage].
- Return type:
List the available history of the conversation.
- do_reset() virtual¶
Reset the conversation to the initial state.
- do_send_messages(roles, messages) virtual¶
- Parameters:
- Returns:
a [class`Dex`.Future] that resolves to any value or rejects with error.
- Return type:
Send multiple messages together.
The length of roles must be the same as messages.
Property Details¶
- Foundry.LlmConversation.props.is_busy¶
- Foundry.LlmConversation.props.tools¶
- Name:
tools- Type:
- Default Value:
- Flags: