AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.compute.openai_client.AquinOpenAIProxy Class Reference
Collaboration diagram for aquin.compute.openai_client.AquinOpenAIProxy:

Public Member Functions

None __init__ (self, str api_key, str base_url, str session_id="")

Public Attributes

 chat = SimpleNamespace(completions=_ProxyChatCompletions(self))
 embeddings = _ProxyEmbeddings(self)

Protected Member Functions

dict[str, str] _headers (self)
dict[str, Any] _post (self, str path, dict[str, Any] payload)
dict[str, Any] _chat (self, dict[str, Any] payload)
dict[str, Any] _embeddings (self, dict[str, Any] payload)

Protected Attributes

 _api_key = api_key
 _base_url = base_url.rstrip("/")
 _session_id = session_id.strip()

Detailed Description

Uses OPENAI_API_KEY from the Next.js app (Bearer AQUIN_API_KEY), like aquin chat.

Definition at line 67 of file openai_client.py.

Constructor & Destructor Documentation

◆ __init__()

None aquin.compute.openai_client.AquinOpenAIProxy.__init__ ( self,
str api_key,
str base_url,
str session_id = "" )

Definition at line 70 of file openai_client.py.

Member Function Documentation

◆ _chat()

dict[str, Any] aquin.compute.openai_client.AquinOpenAIProxy._chat ( self,
dict[str, Any] payload )
protected

Definition at line 94 of file openai_client.py.

References _post(), and _session_id.

◆ _embeddings()

dict[str, Any] aquin.compute.openai_client.AquinOpenAIProxy._embeddings ( self,
dict[str, Any] payload )
protected

Definition at line 100 of file openai_client.py.

References _post(), and _session_id.

◆ _headers()

dict[str, str] aquin.compute.openai_client.AquinOpenAIProxy._headers ( self)
protected

Definition at line 77 of file openai_client.py.

Referenced by _post().

◆ _post()

dict[str, Any] aquin.compute.openai_client.AquinOpenAIProxy._post ( self,
str path,
dict[str, Any] payload )
protected

Definition at line 80 of file openai_client.py.

References _headers().

Referenced by _chat(), and _embeddings().

Member Data Documentation

◆ _api_key

aquin.compute.openai_client.AquinOpenAIProxy._api_key = api_key
protected

Definition at line 71 of file openai_client.py.

Referenced by aquin.saes.SaesNamespace.pull().

◆ _base_url

aquin.compute.openai_client.AquinOpenAIProxy._base_url = base_url.rstrip("/")
protected

Definition at line 72 of file openai_client.py.

◆ _session_id

aquin.compute.openai_client.AquinOpenAIProxy._session_id = session_id.strip()
protected

Definition at line 73 of file openai_client.py.

Referenced by _chat(), and _embeddings().

◆ chat

aquin.compute.openai_client.AquinOpenAIProxy.chat = SimpleNamespace(completions=_ProxyChatCompletions(self))

Definition at line 74 of file openai_client.py.

◆ embeddings

aquin.compute.openai_client.AquinOpenAIProxy.embeddings = _ProxyEmbeddings(self)

Definition at line 75 of file openai_client.py.


The documentation for this class was generated from the following file: