Interface GenerativeModel
- All Known Implementing Classes:
OllamaBackend
public interface GenerativeModel
Interface representing a Generative AI model (e.g., Large Language Model).
Provides methods for generating text and embeddings.
- Since:
- 2.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classRepresent a response from the model, which can be text or a tool call. -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<float[]> Generates vector embeddings for the given text.Generates a response for the given prompt.Generates a response considering available tools.Returns the name of the model being used (e.g., "gpt-4", "llama3").
-
Method Details
-
generate
Generates a response for the given prompt.- Parameters:
prompt- the input text.- Returns:
- a future containing the generated text.
-
generate
Generates a response considering available tools.- Parameters:
prompt- the input text.tools- list of available tools.- Returns:
- a future containing either text or a tool call.
-
embed
Generates vector embeddings for the given text.- Parameters:
text- the input text.- Returns:
- a future containing the embedding vector (as float array).
-
getModelName
String getModelName()Returns the name of the model being used (e.g., "gpt-4", "llama3").
-