Uses of Class
com.composum.ai.backend.base.service.GPTException
-
Packages that use GPTException Package Description com.composum.ai.backend.base.service com.composum.ai.backend.base.service.chat com.composum.ai.backend.base.service.chat.impl -
-
Uses of GPTException in com.composum.ai.backend.base.service
Subclasses of GPTException in com.composum.ai.backend.base.service Modifier and Type Class Description static classGPTException.GPTContextLengthExceededException{ "error": { "message": "This model's maximum context length is 4097 tokens.static classGPTException.GPTRetryableResponseErrorExceptionAn exception that is thrown when the response from the GPT service is not as expected.static classGPTException.GPTUserNotificationExceptionA special exception if the user should be notified about something instead of completing the task.Methods in com.composum.ai.backend.base.service that return GPTException Modifier and Type Method Description static GPTExceptionGPTException. buildException(Integer errorStatusCode, String result) -
Uses of GPTException in com.composum.ai.backend.base.service.chat
Methods in com.composum.ai.backend.base.service.chat that throw GPTException Modifier and Type Method Description StringGPTContentCreationService. executePrompt(String prompt, GPTChatRequest additionalParameters)Executes a given prompt from the user using ChatGPT.StringGPTContentCreationService. executePromptOnText(String prompt, String text, GPTChatRequest additionalParameters)Executes a given prompt from the user using ChatGPT, using the given text as context.voidGPTContentCreationService. executePromptOnTextStreaming(String prompt, String text, GPTChatRequest additionalParameters, GPTCompletionCallback callback)Executes a given prompt from the user using ChatGPT, using the given text as context.voidGPTContentCreationService. executePromptStreaming(String prompt, GPTChatRequest additionalParameters, GPTCompletionCallback callback)Executes a given prompt from the user using ChatGPT.List<String>GPTEmbeddingService. findMostRelated(String query, List<String> comparedStrings, int limit, GPTConfiguration configuration, GPTEmbeddingService.EmbeddingsCache cache)Determines the at most limit to query semantically closest of the comparedStrings according to the embedding service.default List<String>GPTTranslationService. fragmentedTranslation(List<String> texts, String targetLanguage, GPTConfiguration configuration)Translates the texts into the target language.List<String>GPTTranslationService. fragmentedTranslation(List<String> texts, String targetLanguage, GPTConfiguration configuration, List<GPTResponseCheck> translationChecks)Translates the texts into the target language.StringGPTContentCreationService. generateDescription(String text, int maxwords, GPTConfiguration configuration)Generates a description from the given text.List<String>GPTContentCreationService. generateKeywords(String text, GPTConfiguration configuration)Generates a list of keywords from the given text.List<float[]>GPTChatCompletionService. getEmbeddings(List<String> texts, GPTConfiguration configuration)Calculates embeddings for the given list of texts.List<float[]>GPTEmbeddingService. getEmbeddings(List<String> texts, GPTConfiguration configuration, GPTEmbeddingService.EmbeddingsCache cache)Get embeddings for the given texts.StringGPTChatCompletionService. getSingleChatCompletion(GPTChatRequest request)The simplest case: give some messages and get a single response.GPTChatMessagesTemplateGPTChatCompletionService. getTemplate(String templateName)Retrieves a (usually cached) chat template with that name.StringGPTChatCompletionService. shorten(String text, int maxTokens)Helper method to shorten texts by taking out the middle if too long.StringGPTTranslationService. singleTranslation(String text, String sourceLanguage, String targetLanguage, GPTConfiguration configuration)Translate the text from the target to destination language, either Java locale name or language name.voidGPTChatCompletionService. streamingChatCompletion(GPTChatRequest request, GPTCompletionCallback callback)Give some messages and receive the streaming response via callback, to reduce waiting time.voidGPTChatCompletionService. streamingChatCompletionWithToolCalls(GPTChatRequest request, GPTCompletionCallback callback)Give some messages and receive the streaming response via callback, to reduce waiting time.voidGPTTranslationService. streamingSingleTranslation(String text, String sourceLanguage, String targetLanguage, GPTConfiguration configuration, GPTCompletionCallback callback)Translate the text from the target to destination language, either Java locale name or language name.Constructors in com.composum.ai.backend.base.service.chat that throw GPTException Constructor Description GPTChatMessagesTemplate(InputStream stream, String name)Reads the template from the stream, which is closed afterwards.GPTChatMessagesTemplate(ClassLoader classLoader, String name)Reads the template from the classloader.GPTChatMessagesTemplate(org.osgi.framework.Bundle bundle, String templateName)Reads the template from an OSGI bundle. -
Uses of GPTException in com.composum.ai.backend.base.service.chat.impl
Methods in com.composum.ai.backend.base.service.chat.impl that throw GPTException Modifier and Type Method Description voidGPTContentCreationServiceImpl. executePromptOnTextStreaming(String prompt, String text, GPTChatRequest additionalParameters, GPTCompletionCallback callback)voidGPTContentCreationServiceImpl. executePromptStreaming(String prompt, GPTChatRequest additionalParameters, GPTCompletionCallback callback)List<String>GPTEmbeddingServiceImpl. findMostRelated(String query, List<String> comparedStrings, int limit, GPTConfiguration configuration, GPTEmbeddingService.EmbeddingsCache thecache)protected List<String>GPTTranslationServiceImpl. fragmentedTranslation(List<String> texts, String targetLanguage, GPTConfiguration configuration, AtomicInteger permittedRetries, List<GPTResponseCheck> translationChecks)List<String>GPTTranslationServiceImpl. fragmentedTranslation(List<String> texts, String targetLanguage, GPTConfiguration configuration, List<GPTResponseCheck> translationChecks)We join all text fragments we have to translate into one big texts separated with separators like `%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 573472 %%%%%%%%%%%%%%%%` and then translate that.protected List<String>GPTTranslationServiceImpl. fragmentedTranslationDivideAndConquer(List<String> texts, String targetLanguage, GPTConfiguration configuration, AtomicInteger permittedRetries, List<GPTResponseCheck> translationChecks)We try to translate the whole lot of texts.List<float[]>GPTChatCompletionServiceImpl. getEmbeddings(List<String> texts, GPTConfiguration configuration)List<float[]>GPTEmbeddingServiceImpl. getEmbeddings(List<String> texts, GPTConfiguration configuration, GPTEmbeddingService.EmbeddingsCache cache)StringGPTChatCompletionServiceImpl. getSingleChatCompletion(GPTChatRequest request)GPTChatMessagesTemplateGPTChatCompletionServiceImpl. getTemplate(String templateName)voidGPTChatCompletionServiceImpl. streamingChatCompletion(GPTChatRequest request, GPTCompletionCallback callback)voidGPTChatCompletionServiceImpl. streamingChatCompletionWithToolCalls(GPTChatRequest request, GPTCompletionCallback callback)voidGPTTranslationServiceImpl. streamingSingleTranslation(String text, String sourceLanguage, String targetLanguage, GPTConfiguration configuration, GPTCompletionCallback callback)
-