Skip to main content

LocalOpenAiProvider

Struct LocalOpenAiProvider 

Source
pub struct LocalOpenAiProvider { /* private fields */ }

Implementations§

Source§

impl LocalOpenAiProvider

Source

pub fn new() -> Self

Source

pub async fn list_models(&self, base: &str) -> Result<Vec<String>, CloudAiError>

Query the server’s GET /v1/models and return the available model ids. Used by the Settings “Test connection” button to populate the model dropdown with what’s actually loaded. base accepts any of the forms normalize_local_base tolerates.

Trait Implementations§

Source§

impl CloudAiProvider for LocalOpenAiProvider

Source§

fn name(&self) -> &str

Source§

fn env_var(&self) -> &str

Convention-based environment variable name for this provider’s API key.
Source§

fn default_models(&self) -> &[&str]

Default models suggested in the UI dropdown. Users can also type any model name the provider accepts.
Source§

fn category(&self) -> ProviderCategory

Local vs cloud. Defaults to Cloud so existing providers need no change; the local OpenAI-compatible provider overrides it.
Source§

fn invoke<'life0, 'life1, 'async_trait>( &'life0 self, req: &'life1 CloudAiRequest, ) -> Pin<Box<dyn Future<Output = Result<CloudAiResponse, CloudAiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn invoke_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, req: &'life1 CloudAiRequest, sink: &'life2 dyn LlmStreamSink, ) -> Pin<Box<dyn Future<Output = Result<CloudAiResponse, CloudAiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Streaming variant of invoke. Providers that support real streaming override this to push tokens through sink as they arrive; the default impl wraps invoke and emits a single done = true event so non-streaming providers are still observable on the chip without per-call branching at the call site. Read more
Source§

fn invoke_tools<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, req: &'life1 CloudAiRequest, tools: &'life2 [ToolSpec], dispatcher: &'life3 dyn ToolDispatcher, max_iters: usize, ) -> Pin<Box<dyn Future<Output = Result<CloudAiResponse, CloudAiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Tool-use / function-calling loop. Providers that support tools override this: they expose tools to the model, run each requested call through dispatcher, feed the results back, and repeat until the model stops asking (or max_iters is hit). The default ignores tools and does a single invoke, so providers without tool support degrade gracefully.
Source§

fn embed<'life0, 'life1, 'async_trait>( &'life0 self, req: &'life1 CloudAiRequest, ) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, CloudAiError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Embeddings call for task: "embedding". Providers with an embeddings endpoint override this; the default reports the capability unsupported (e.g. Anthropic exposes no embeddings API).
Source§

fn model_capabilities(&self) -> Vec<ModelCapabilityInfo>

Per-model capability tags advertised to the UI, using the same vocabulary as the Hub catalog (code | tool_use | reasoning | vision | embedding). The node inspector gates capability-specific fields (image input, thinking, tool binding) on these the same way it does for local models resolved from the Hub. Cloud providers override this; the default advertises nothing, so the inspector falls back to showing every field.
Source§

impl Default for LocalOpenAiProvider

Source§

fn default() -> Self

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

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,