All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fi.evolver.ai.spring.chat.ChatApi Maven / Gradle / Ivy

package fi.evolver.ai.spring.chat;

import java.time.Duration;

import fi.evolver.ai.spring.Api;
import fi.evolver.ai.spring.chat.prompt.ChatPrompt;

public interface ChatApi extends Api {
	public static final String MAX_TOKENS = "max_tokens";
	public static final String STREAM = "stream";
	public static final String TEMPERATURE = "temperature";
	public static final String TOP_P = "top_p";
	public static final String TOP_K = "top_k";
	public static final String USER = "user";


	public static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(30);


	/**
	 * Make a chat completion request to the API.
	 *
	 * @param prompt The prompt.
	 * @return The completions response
	 */
	public ChatResponse send(ChatPrompt prompt);

	/**
	 * Parse ChatResponse from raw LLM response data
	 *
	 * @param rawResponse The LLM response
	 * @return The completions response
	 */
	default ChatResponse parseChatResponse(String rawResponse) {
		throw new UnsupportedOperationException();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy