Chat
Object Hierarchy:
Description:
Chat API call implementation for sending messages and receiving responses.
Handles chat conversations with the LLM, including message history, tool calling, streaming responses, and automatic tool execution.
Manages the conversation flow and tool call recursion. Automatically executes tools when the model requests them and continues the
conversation with tool results.
Example
var call = new Call.Chat(client, "llama3.2");
call.messages.add(new Message("user", "Hello!"));
// Execute chat (handles tool calls automatically)
var response = yield call.send(call.messages);
// Access response content
print(response.message.content);
Content:
Properties:
- public string? format { get; set; }
Format to return a response in.
- public Object? format_obj { get; set; }
JSON schema object for structured outputs. When set, this will be
serialized as the "format" field instead of the string format property. Used for Ollama's structured output feature.
- public string? keep_alive { get; set; }
Model keep-alive duration.
- public override string model { get; set; }
- public override Options options { get; set; }
Runtime options that control text generation.
- public override bool think { get; set; }
Enable separate thinking output in addition to content.
Creation methods:
Methods:
Inherited Members:
All known members inherited from class OLLMchat.Call.ChatBase
All known members inherited from class OLLMchat.Call.Base
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface
OLLMchat.ChatContentInterface
All known members inherited from interface Json.Serializable
- default_deserialize_property
- default_serialize_property
- deserialize_property
- find_property
- get_property
- list_properties
- serialize_property
- set_property