pub struct ProviderChoice {
pub tag: String,
pub pick: Pick,
}Expand description
The provider and what a profile of AccountKind::Provider runs on: the person’s own tag
from the Providers page, and either one of that provider’s models or one of its lineups.
The tag is kept as the text it was written with rather than a checked
crate::provider::Tag: a profile is read long after the provider it names may have been
removed, and a tag the file cannot make sense of any more is still worth showing back to the
person as the reason nothing starts, not a reason to lose the rest of the profile.
Fields§
§tag: StringThe provider’s tag, as the Providers page names it.
pick: PickWhat the tab asks for: a model, or a lineup of the provider’s own models.
Implementations§
Source§impl ProviderChoice
impl ProviderChoice
Sourcepub fn model(tag: impl Into<String>, id: impl Into<String>) -> Self
pub fn model(tag: impl Into<String>, id: impl Into<String>) -> Self
A profile that runs on one model of tag, the way every profile before a lineup existed is
written.
Sourcepub fn lineup(tag: impl Into<String>, name: impl Into<String>) -> Self
pub fn lineup(tag: impl Into<String>, name: impl Into<String>) -> Self
A profile that runs on the lineup name of tag, whose steps the relay asks in order.
Sourcepub fn asked(&self) -> &str
pub fn asked(&self) -> &str
The name a harness is told to ask for: the model’s own, or the lineup’s, which the relay turns into that lineup’s steps. A harness is told one name whatever it runs on, so the name is the choice the person made rather than a step of it they never saw.
Sourcepub fn environment(
&self,
harness: HarnessKind,
token: &str,
window: Option<u64>,
) -> Vec<(String, String)>
pub fn environment( &self, harness: HarnessKind, token: &str, window: Option<u64>, ) -> Vec<(String, String)>
The environment a tab of harness on this provider is started with, so the harness
speaks to the workspace’s relay at http://127.0.0.1:<crate::provider::relay::PORT>
instead of the provider’s own address, asking for ProviderChoice::asked. Empty for a
harness that is not offered a provider of one’s own.
window is what QCode measured this server really gives for that model, when it has been
measured: the harness is told that rather than left to assume its own models’ room.
token is the tab’s own bridge token, carried again rather than a second one minted for
it: the relay resolves a tab’s provider entry by the very token
crate::bridge::TOKEN_VARIABLE already carries, and the harness needs some non-empty
value here to send a request at all, never the provider’s real key — that never leaves
this machine’s own process.
Sourcepub fn arguments(&self, harness: HarnessKind) -> Vec<String>
pub fn arguments(&self, harness: HarnessKind) -> Vec<String>
The arguments a tab of harness on this provider is started with, right after the
program, for a harness that is told of a provider on its command line rather than in its
environment. Empty for every other harness.
Codex is the one: it reads a provider of one’s own only from its configuration, which -c
sets for one run, and nothing of it is a secret. The provider is named qcode, asked at the
relay’s /v1 in the Responses shape, and sends as its key the variable that already holds
the tab’s token (crate::bridge::TOKEN_VARIABLE). Its web search is turned off: that
tool is one OpenAI’s own servers run, and a provider that is not OpenAI refuses the whole
request for naming it (MiMo, measured: “tool type ‘web_search’ is not supported”).
Sourcepub fn endpoint(wire: Wire) -> String
pub fn endpoint(wire: Wire) -> String
The address a harness inside the container is given for this provider in shape wire:
always the workspace’s relay, written the way a client of that shape expects its base —
the bare address for the Anthropic shape, which clients follow with /v1/messages, and
/v1 for the OpenAI one, which clients follow with /chat/completions. Where the
provider really answers that shape, and which header its key goes in, is the relay’s to
know; a harness is only ever told this address.
Trait Implementations§
Source§impl Clone for ProviderChoice
impl Clone for ProviderChoice
Source§impl Debug for ProviderChoice
impl Debug for ProviderChoice
impl Eq for ProviderChoice
Source§impl PartialEq for ProviderChoice
impl PartialEq for ProviderChoice
impl StructuralPartialEq for ProviderChoice
Auto Trait Implementations§
impl Freeze for ProviderChoice
impl RefUnwindSafe for ProviderChoice
impl Send for ProviderChoice
impl Sync for ProviderChoice
impl Unpin for ProviderChoice
impl UnsafeUnpin for ProviderChoice
impl UnwindSafe for ProviderChoice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more