Class OpenAiChatCompletionClient
java.lang.Object
ch.tocco.nice2.optional.aiassistant.impl.function.manual.OpenAiChatCompletionClient
- All Implemented Interfaces:
ChatCompletionClient
ChatCompletionClient backed by an OpenAI-compatible /chat/completions endpoint,
configured via ManualParameterProvider. Tool calls are executed locally and their results
sent back to the LLM, for at most MAX_TOOL_ROUNDS rounds; then the LLM must answer.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChatCompletionClient
ChatCompletionClient.Turn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringcomplete(String systemPrompt, List<ChatCompletionClient.Turn> conversation) @Nullable Stringcomplete(String systemPrompt, List<ChatCompletionClient.Turn> conversation, TextResourceSearchTool tool) Same asChatCompletionClient.complete(String, List), but the LLM has to call the tool before it answers.
-
Constructor Details
-
OpenAiChatCompletionClient
-
-
Method Details
-
complete
- Specified by:
completein interfaceChatCompletionClient- Parameters:
systemPrompt- instructions for the assistant (grounding, citation, language)conversation- ordered turns, each authored by theRole.USERorRole.ASSISTANT- Returns:
- the assistant's answer text, or
nullif the provider returned no content
-
complete
public @Nullable String complete(String systemPrompt, List<ChatCompletionClient.Turn> conversation, TextResourceSearchTool tool) Description copied from interface:ChatCompletionClientSame asChatCompletionClient.complete(String, List), but the LLM has to call the tool before it answers.- Specified by:
completein interfaceChatCompletionClient
-