pub struct Client { /* private fields */ }Expand description
arknet SDK client. Wraps an HTTP connection to a node’s OpenAI-compatible API surface.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(base_url: &str) -> Result<Self>
pub fn new(base_url: &str) -> Result<Self>
Create a new client pointing at an arknet node.
base_url should be the node’s HTTP root, e.g.
http://127.0.0.1:3000. The client appends /v1/... paths.
Create a new client pointing at an arknet node.
Reads wallet address from ARKNET_WALLET env var if not
provided explicitly via ConnectOptions.
Sourcepub async fn connect(opts: ConnectOptions) -> Result<Self>
pub async fn connect(opts: ConnectOptions) -> Result<Self>
Auto-discover a gateway from the on-chain registry.
Fetches the live seed list from seeds.json on the arknet
website, then contacts each seed’s /v1/gateways. If the
seed list is unreachable, falls back to the hardcoded list.
No code changes needed to add new seeds — just edit seeds.json.
Sourcepub async fn chat_completion(&self, req: ChatRequest) -> Result<ChatResponse>
pub async fn chat_completion(&self, req: ChatRequest) -> Result<ChatResponse>
Non-streaming chat completion.
Sourcepub async fn list_models(&self) -> Result<ModelsResponse>
pub async fn list_models(&self) -> Result<ModelsResponse>
List models from the on-chain registry.
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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
Mutably borrows from an owned value. Read more