Chat model adapter for the DeepSeek API. More...
Public Member Functions | |
| DeepSeekChatModel (final DeepSeekConfig config) | |
| Creates a new model with a default HTTP client and JSON codec. | |
| DeepSeekChatModel (final DeepSeekConfig config, final HttpClient httpClient, final JsonCodec jsonCodec) | |
| Creates a new model with a custom HTTP client and JSON codec. | |
| AiChatResponse | generate (final AiChatRequest request) throws IOException, InterruptedException |
| Sends a chat completion request to the DeepSeek API and returns the parsed response. | |
Chat model adapter for the DeepSeek API.
Implements AiChatModel by sending HTTP requests to the DeepSeek chat completions endpoint and mapping JSON responses back to Ether AI domain objects.
Definition at line 58 of file DeepSeekChatModel.java.
| dev.rafex.ether.ai.deepseek.chat.DeepSeekChatModel.DeepSeekChatModel | ( | final DeepSeekConfig | config | ) |
Creates a new model with a default HTTP client and JSON codec.
| config | DeepSeek connection configuration |
Definition at line 74 of file DeepSeekChatModel.java.
References dev.rafex.ether.json.JsonUtils.codec().
| dev.rafex.ether.ai.deepseek.chat.DeepSeekChatModel.DeepSeekChatModel | ( | final DeepSeekConfig | config, |
| final HttpClient | httpClient, | ||
| final JsonCodec | jsonCodec ) |
Creates a new model with a custom HTTP client and JSON codec.
| config | DeepSeek connection configuration |
| httpClient | pre-configured HTTP client to use for requests |
| jsonCodec | JSON codec for serialization; falls back to the default codec when null |
Definition at line 85 of file DeepSeekChatModel.java.
References dev.rafex.ether.json.JsonUtils.codec().
| AiChatResponse dev.rafex.ether.ai.deepseek.chat.DeepSeekChatModel.generate | ( | final AiChatRequest | request | ) | throws IOException, InterruptedException |
Sends a chat completion request to the DeepSeek API and returns the parsed response.
| request | the chat request containing model, messages and generation parameters |
| IOException | if an I/O error occurs during the HTTP call or response parsing |
| InterruptedException | if the current thread is interrupted while waiting for the HTTP response |
| AiHttpException | if the DeepSeek API returns a non-2xx HTTP status code |
Implements dev.rafex.ether.ai.core.chat.AiChatModel.
Definition at line 101 of file DeepSeekChatModel.java.
References dev.rafex.ether.ai.core.message.AiMessageRole.fromWireValue().