Uses of Class
dev.langchain4j.service.AiServices
Packages that use AiServices
-
Uses of AiServices in dev.langchain4j.service
Methods in dev.langchain4j.service that return AiServicesModifier and TypeMethodDescriptionstatic <T> AiServices
<T> Begins the construction of an AI Service.AiServices.chatLanguageModel
(ChatLanguageModel chatLanguageModel) Configures chat model that will be used under the hood of the AI Service.AiServices.chatMemory
(ChatMemory chatMemory) Configures the chat memory that will be used to preserve conversation history between method calls.AiServices.chatMemoryProvider
(ChatMemoryProvider chatMemoryProvider) Configures the chat memory provider, which provides a dedicated instance ofChatMemory
for each user/conversation.AiServices.contentRetriever
(ContentRetriever contentRetriever) Configures a content retriever to be invoked on every method call for retrieving relevant content related to the user's message from an underlying data source (e.g., an embedding store in the case of anEmbeddingStoreContentRetriever
).AiServices.hallucinatedToolNameStrategy
(Function<ToolExecutionRequest, ToolExecutionResultMessage> hallucinatedToolNameStrategy) Configures the strategy to be used when the LLM hallucinates a tool name (i.e., attempts to call a nonexistent tool).AiServices.moderationModel
(ModerationModel moderationModel) Configures a moderation model to be used for automatic content moderation.AiServices.retrievalAugmentor
(RetrievalAugmentor retrievalAugmentor) Configures a retrieval augmentor to be invoked on every method call.AiServices.retriever
(Retriever<TextSegment> retriever) Deprecated, for removal: This API element is subject to removal in a future version.AiServices.streamingChatLanguageModel
(StreamingChatLanguageModel streamingChatLanguageModel) Configures streaming chat model that will be used under the hood of the AI Service.AiServices.systemMessageProvider
(Function<Object, String> systemMessageProvider) Configures the system message provider, which provides a system message to be used each time an AI service is invoked.AiServices.toolProvider
(ToolProvider toolProvider) Configures the tool provider that the LLM can useConfigures the tools that the LLM can use.AiServices.tools
(Collection<Object> objectsWithTools) Configures the tools that the LLM can use.AiServices.tools
(Map<ToolSpecification, ToolExecutor> tools) Configures the tools that the LLM can use. -
Uses of AiServices in dev.langchain4j.spi.services
Methods in dev.langchain4j.spi.services that return AiServicesModifier and TypeMethodDescription<T> AiServices
<T> AiServicesFactory.create
(AiServiceContext context)
contentRetriever(ContentRetriever)
(e.g.