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 class
GPTException.GPTContextLengthExceededException
static class
GPTException.GPTRetryableResponseErrorException
An exception that is thrown when the response from the GPT service is not as expected. -
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 String
GPTContentCreationService. executePrompt(String prompt, GPTChatRequest additionalParameters)
Executes a given prompt from the user using ChatGPT.String
GPTContentCreationService. executePromptOnText(String prompt, String text, GPTChatRequest additionalParameters)
Executes a given prompt from the user using ChatGPT, using the given text as context.void
GPTContentCreationService. executePromptOnTextStreaming(String prompt, String text, GPTChatRequest additionalParameters, GPTCompletionCallback callback)
Executes a given prompt from the user using ChatGPT, using the given text as context.void
GPTContentCreationService. 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.List<String>
GPTTranslationService. fragmentedTranslation(List<String> texts, String targetLanguage, GPTConfiguration configuration)
Translates the texts into the target language.String
GPTContentCreationService. 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.String
GPTChatCompletionService. getSingleChatCompletion(GPTChatRequest request)
The simplest case: give some messages and get a single response.GPTChatMessagesTemplate
GPTChatCompletionService. getTemplate(String templateName)
Retrieves a (usually cached) chat template with that name.String
GPTChatCompletionService. shorten(String text, int maxTokens)
Helper method to shorten texts by taking out the middle if too long.String
GPTTranslationService. 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.void
GPTChatCompletionService. streamingChatCompletion(GPTChatRequest request, GPTCompletionCallback callback)
Give some messages and receive the streaming response via callback, to reduce waiting time.void
GPTTranslationService. 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. -
Uses of GPTException in com.composum.ai.backend.base.service.chat.impl
Methods in com.composum.ai.backend.base.service.chat.impl that return GPTException Modifier and Type Method Description protected static GPTException
GPTChatCompletionServiceImpl. buildException(Integer errorStatusCode, String result)
Methods in com.composum.ai.backend.base.service.chat.impl that throw GPTException Modifier and Type Method Description void
GPTContentCreationServiceImpl. executePromptOnTextStreaming(String prompt, String text, GPTChatRequest additionalParameters, GPTCompletionCallback callback)
void
GPTContentCreationServiceImpl. executePromptStreaming(String prompt, GPTChatRequest additionalParameters, GPTCompletionCallback callback)
List<String>
GPTEmbeddingServiceImpl. findMostRelated(String query, List<String> comparedStrings, int limit, GPTConfiguration configuration, GPTEmbeddingService.EmbeddingsCache thecache)
List<String>
GPTTranslationServiceImpl. fragmentedTranslation(List<String> texts, String targetLanguage, GPTConfiguration configuration)
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. fragmentedTranslation(List<String> texts, String targetLanguage, GPTConfiguration configuration, AtomicInteger permittedRetries)
protected List<String>
GPTTranslationServiceImpl. fragmentedTranslationDivideAndConquer(List<String> texts, String targetLanguage, GPTConfiguration configuration, AtomicInteger permittedRetries)
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)
String
GPTChatCompletionServiceImpl. getSingleChatCompletion(GPTChatRequest request)
GPTChatMessagesTemplate
GPTChatCompletionServiceImpl. getTemplate(String templateName)
void
GPTChatCompletionServiceImpl. streamingChatCompletion(GPTChatRequest request, GPTCompletionCallback callback)
void
GPTTranslationServiceImpl. streamingSingleTranslation(String text, String sourceLanguage, String targetLanguage, GPTConfiguration configuration, GPTCompletionCallback callback)
Constructors in com.composum.ai.backend.base.service.chat.impl that throw GPTException Constructor Description GPTChatMessagesTemplate(InputStream stream, String name)
GPTChatMessagesTemplate(ClassLoader classLoader, String name)
GPTChatMessagesTemplate(org.osgi.framework.Bundle bundle, String templateName)
-