mirror of
https://github.com/hanzo-kt/sdk.git
synced 2026-10-30 20:43:57 +00:00
Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
4.6 KiB
4.6 KiB
AgentsOpenAICompatibleApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| chatGetAgentsV1Models | GET /v1/chat/agents/v1/models | List agents as models |
| chatGetAgentsV1ModelsBymodel | GET /v1/chat/agents/v1/models/{model} | Get agent/model details |
| chatPostAgentsV1ChatCompletions | POST /v1/chat/agents/v1/chat/completions | OpenAI-compatible chat completions |
chatGetAgentsV1Models
ChatGetAgentsV1Models200Response chatGetAgentsV1Models()
List agents as models
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = AgentsOpenAICompatibleApi()
try {
val result : ChatGetAgentsV1Models200Response = apiInstance.chatGetAgentsV1Models()
println(result)
} catch (e: ClientException) {
println("4xx response calling AgentsOpenAICompatibleApi#chatGetAgentsV1Models")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AgentsOpenAICompatibleApi#chatGetAgentsV1Models")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
ChatGetAgentsV1Models200Response
Authorization
Configure BearerAuth statically:
ApiClient.accessToken = ""
Configure BearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
chatGetAgentsV1ModelsBymodel
ChatModelObject chatGetAgentsV1ModelsBymodel(model)
Get agent/model details
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = AgentsOpenAICompatibleApi()
val model : kotlin.String = model_example // kotlin.String |
try {
val result : ChatModelObject = apiInstance.chatGetAgentsV1ModelsBymodel(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling AgentsOpenAICompatibleApi#chatGetAgentsV1ModelsBymodel")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AgentsOpenAICompatibleApi#chatGetAgentsV1ModelsBymodel")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| model | kotlin.String |
Return type
Authorization
Configure BearerAuth statically:
ApiClient.accessToken = ""
Configure BearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
chatPostAgentsV1ChatCompletions
ChatChatCompletion chatPostAgentsV1ChatCompletions(chatPostAgentsV1ChatCompletionsRequest)
OpenAI-compatible chat completions
Send chat messages to an agent using OpenAI format. Requires API key auth.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = AgentsOpenAICompatibleApi()
val chatPostAgentsV1ChatCompletionsRequest : ChatPostAgentsV1ChatCompletionsRequest = // ChatPostAgentsV1ChatCompletionsRequest |
try {
val result : ChatChatCompletion = apiInstance.chatPostAgentsV1ChatCompletions(chatPostAgentsV1ChatCompletionsRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling AgentsOpenAICompatibleApi#chatPostAgentsV1ChatCompletions")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AgentsOpenAICompatibleApi#chatPostAgentsV1ChatCompletions")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| chatPostAgentsV1ChatCompletionsRequest | ChatPostAgentsV1ChatCompletionsRequest |
Return type
Authorization
Configure BearerAuth statically:
ApiClient.accessToken = ""
Configure BearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json