Package com.tnsai.llm.providers
Class CohereClient
java.lang.Object
com.tnsai.llm.providers.AbstractLLMClient
com.tnsai.llm.providers.CohereClient
- All Implemented Interfaces:
com.tnsai.llm.LLMClient
Cohere LLM client implementation.
Optimized for RAG (Retrieval Augmented Generation) and Enterprise use cases.
Supported models:
- command-r-plus - Best for complex RAG, reasoning, multi-step tools
- command-r - Optimized for RAG and tool use, lower latency
- command - Instruction following
Configuration via environment variables:
- COHERE_API_KEY - Required API key
- COHERE_BASE_URL - Optional, defaults to https://api.cohere.com/v1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCohereClient(String model) CohereClient(String model, float temperature, Float topP, Integer maxTokens) CohereClient(String model, float temperature, Integer maxTokens) CohereClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey) CohereClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey) -
Method Summary
Modifier and TypeMethodDescriptioncom.tnsai.llm.ChatResponsechat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) streamChat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) Methods inherited from class com.tnsai.llm.providers.AbstractLLMClient
getBaseUrl, getCallTimeoutMs, getMaxTokens, getModel, getTemperature, getTopPMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tnsai.llm.LLMClient
chat, chat, chat, chat, chat, getCapabilities, getProviderName, listModels, streamChat, streamChat, streamChatWithHandler, streamChatWithHandler, streamChatWithSpec, streamChatWithSpec
-
Constructor Details
-
CohereClient
-
CohereClient
-
CohereClient
-
CohereClient
-
CohereClient
-
-
Method Details
-
chat
-
streamChat
-