http
NexosAIAPIService
dataclass
Abstract class for asynchronous services.
request
async
Send an HTTP request using the configured client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verb
|
str
|
The HTTP method to use (e.g., 'GET', 'POST'). |
required |
url
|
str
|
The URL to which the request is sent. If |
required |
override_base
|
bool
|
If True, the base URL will not be prepended to the provided URL. |
False
|
Returns:
| Type | Description |
|---|---|
Response
|
The HTTP response. |
Source code in src/nexosapi/services/http.py
construct_headers
construct_headers(
config: NexosAIAPIConfiguration,
) -> dict[str, str]
Construct headers for the HTTP request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
NexosAIAPIConfiguration
|
The configuration for the API service. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
A dictionary of headers. |
Source code in src/nexosapi/services/http.py
construct_auth
construct_auth(
config: NexosAIAPIConfiguration,
) -> Auth | None
Construct authentication for the HTTP request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
NexosAIAPIConfiguration
|
The configuration for the API service. |
required |
Returns:
| Type | Description |
|---|---|
Auth | None
|
A httpx.Auth object or None if no authentication is needed. |