AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.compute.openai_client Namespace Reference

Classes

class  _ProxyChatCompletions
class  _ProxyEmbeddings
class  AquinOpenAIProxy

Functions

dict[str, str] _read_json (Path path)
str _saved_api_key ()
Any|None get_openai_client (dict[str, Any]|None ctx=None)

Variables

str _CONFIG_PATH = Path.home() / ".aquin" / "config.json"
str _ENGINE_STATE = Path.home() / ".aquin" / "engine.json"

Function Documentation

◆ _read_json()

dict[str, str] _read_json ( Path path)
protected

Definition at line 25 of file openai_client.py.

Referenced by get_openai_client().

◆ _saved_api_key()

str _saved_api_key ( )
protected

Definition at line 35 of file openai_client.py.

Referenced by get_openai_client().

◆ get_openai_client()

Any | None get_openai_client ( dict[str, Any] | None ctx = None)
Prefer local OPENAI_API_KEY; otherwise proxy via Aquin web (AQUIN_API_KEY + base URL).
Chat uses /api/sync/sessions/{id}/agent :  same path as aquin chat.

Definition at line 106 of file openai_client.py.

References _read_json(), and _saved_api_key().

Variable Documentation

◆ _CONFIG_PATH

str aquin.compute.openai_client._CONFIG_PATH = Path.home() / ".aquin" / "config.json"
protected

Definition at line 21 of file openai_client.py.

◆ _ENGINE_STATE

str aquin.compute.openai_client._ENGINE_STATE = Path.home() / ".aquin" / "engine.json"
protected

Definition at line 22 of file openai_client.py.