ModelUsage
Object Hierarchy:
Description:
public class ModelUsage : Object, Serializable
Represents model usage configuration (connection, model, and optional options).
This is a reusable class for any feature that needs to specify a connection, model, and optional options. The connection property
references a connection URL from Config2's connections map.
Since:
1.0
Content:
Properties:
- public string connection { get; set; }
Connection URL key (references a connection from the connections map)
- public string model { get; set; }
Model name to use
- public Options options { get; set; }
Optional runtime options (temperature, top_p, top_k, num_ctx, etc.)
Creation methods:
Methods:
- public ModelUsage clone ()
Creates a clone of this ModelUsage.
- public string context_size ()
Returns a pretty string for context size (e.g. "128K ctx"), or "" if
none. Uses options.num_ctx when set, else model_obj.context_length.
- public override bool deserialize_property (string property_name, out Value value, ParamSpec pspec, Node property_node)
- public string display_name ()
Returns the display name for this model (just the model name).
- public string display_name_with_size ()
Returns the display name with size (and optional context from this
usage). Uses model_obj.display_name when available, plus context_size() when set.
- public unowned ParamSpec? find_property (string name)
- public Value get_property (ParamSpec pspec)
- public override Node serialize_property (string property_name, Value value, ParamSpec pspec)
- public void set_property (ParamSpec pspec, Value value)
- public string to_string ()
Returns a string representation of this ModelUsage.
- public async bool verify_model (Config2 config)
Verifies that the model specified in this ModelUsage is available on
the connection.
Fields:
- public bool is_valid
Whether this ModelUsage is valid (connection exists, model is
available).
- public Model? model_obj
Response.Model object for display names and filling in details later.
Not serialized - runtime only.
Inherited Members:
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 Json.Serializable
- default_deserialize_property
- default_serialize_property
- deserialize_property
- find_property
- get_property
- list_properties
- serialize_property
- set_property