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
{ "error": { "message": "This model's maximum context length is 4097 tokens.
static class
GPTException.GPTRetryableResponseErrorException
An exception that is thrown when the response from the GPT service is not as expected.static class
GPTException.GPTUserNotificationException
A 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 GPTException
GPTException. 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 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.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.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
GPTChatCompletionService. streamingChatCompletionWithToolCalls(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.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 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)
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)
String
GPTChatCompletionServiceImpl. getSingleChatCompletion(GPTChatRequest request)
GPTChatMessagesTemplate
GPTChatCompletionServiceImpl. getTemplate(String templateName)
void
GPTChatCompletionServiceImpl. streamingChatCompletion(GPTChatRequest request, GPTCompletionCallback callback)
void
GPTChatCompletionServiceImpl. streamingChatCompletionWithToolCalls(GPTChatRequest request, GPTCompletionCallback callback)
void
GPTTranslationServiceImpl. streamingSingleTranslation(String text, String sourceLanguage, String targetLanguage, GPTConfiguration configuration, GPTCompletionCallback callback)
-