65 lines
1.6 KiB
Python
65 lines
1.6 KiB
Python
from typing import Any
|
|
|
|
from openai.resources.chat.chat import Chat
|
|
from openai.types.chat import ChatCompletion
|
|
|
|
class WalletBalance:
|
|
sol: float
|
|
usdc: float
|
|
def __init__(self, sol: float, usdc: float) -> None: ...
|
|
|
|
class TopUpQuote:
|
|
payment_address: str
|
|
qr: str
|
|
amount_sol: float
|
|
amount_usdc: float
|
|
def __init__(
|
|
self,
|
|
payment_address: str,
|
|
qr: str,
|
|
amount_sol: float,
|
|
amount_usdc: float,
|
|
) -> None: ...
|
|
|
|
class CostEstimate:
|
|
model: str
|
|
tokens: int
|
|
lamports: int
|
|
sol: float
|
|
def __init__(self, model: str, tokens: int, lamports: int, sol: float) -> None: ...
|
|
|
|
class RedundantRequestResult:
|
|
redundancy: int
|
|
majority_response: ChatCompletion
|
|
responses: list[ChatCompletion]
|
|
def __init__(
|
|
self,
|
|
redundancy: int,
|
|
majority_response: ChatCompletion,
|
|
responses: list[ChatCompletion],
|
|
) -> None: ...
|
|
|
|
class _WalletClient:
|
|
def balance(self) -> WalletBalance: ...
|
|
def top_up(self, *, amount_sol: float = 0.0, amount_usdc: float = 0.0) -> TopUpQuote: ...
|
|
|
|
class _ModelsClient:
|
|
def available(self) -> list[dict[str, float | str]]: ...
|
|
|
|
class Client:
|
|
api_key: str
|
|
base_url: str
|
|
chat: Chat
|
|
wallet: _WalletClient
|
|
models: _ModelsClient
|
|
def __init__(self, *, api_key: str, base_url: str = "https://api.meshnet.ai") -> None: ...
|
|
def estimate_cost(self, *, model: str, tokens: int) -> CostEstimate: ...
|
|
def request(
|
|
self,
|
|
*,
|
|
model: str,
|
|
messages: list[dict[str, Any]],
|
|
redundancy: int = 1,
|
|
**params: Any,
|
|
) -> RedundantRequestResult: ...
|