Skip to main content

Profile

Struct Profile 

Source
pub struct Profile {
    pub id: String,
    pub name: String,
    pub base_url: String,
    pub model: String,
    pub description: String,
    pub api: Option<ApiKind>,
    pub tool_mode: Option<ToolMode>,
    pub subagents: bool,
    pub max_parallel: Option<u16>,
    pub context: Option<u32>,
    pub params: Params,
    pub extra: Map<String, Value>,
}
Expand description

A saved model. Its key is in secrets.json profile_keys.<id>.

Fields§

§id: String

Stable id ([a-z0-9][a-z0-9._-]*); levels and roles point at it. In settings.json the map key is authoritative.

§name: String

What the user calls it.

§base_url: String§model: String§description: String

Free text: what it is good at (“fast, good at code”).

§api: Option<ApiKind>

The API it speaks; None decides from the URL (see InferenceConfig::api_kind).

§tool_mode: Option<ToolMode>

How tools are passed to this model; when set it beats the levels’ tool mode.

§subagents: bool

Offered to the main model as a delegate model choice (its description says when).

§max_parallel: Option<u16>

Most subagents running on this model at once (besides the global cap and the server’s free slots).

§context: Option<u32>

Context window, overriding what the probe found (budgeting and compaction).

§params: Params

Request parameters, sent with every chat request made with it.

§extra: Map<String, Value>

Fields this build doesn’t know (a newer byob’s, or hand edits); preserved.

Implementations§

Source§

impl Profile

Source

pub fn usable(&self) -> bool

Is it usable (a URL and a model)?

Source

pub fn config(&self, key: Option<String>) -> InferenceConfig

The endpoint, with key.

Source

pub fn anthropic(&self) -> bool

Does it speak Anthropic’s Messages API (set, or decided from the URL)?

Source

pub fn points_at(&self, base_url: &str, model: &str) -> bool

Does it point at this endpoint (same URL and model)?

Source

pub fn label(&self) -> &str

The name, or the model when it has none.

Source

pub fn validated(self) -> Result<Profile, String>

Check an untrusted profile: trims text, refuses what doesn’t fit. The id is the caller’s business (the engine makes new ones).

Trait Implementations§

Source§

impl Clone for Profile

Source§

fn clone(&self) -> Profile

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Profile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Profile

Source§

fn default() -> Profile

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Profile

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Profile, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Profile

Source§

fn eq(&self, other: &Profile) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Profile

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Profile

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.