Interface Ai

  • All Implemented Interfaces:

    
    public interface Ai
    
                        

    Gateway to AI functionality in the context of an operation. This includes both LLM and embedding models.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      EmbeddingModel withEmbeddingModel(String model) Return an embedding model with the given name
      abstract EmbeddingModel withEmbeddingModel(ModelSelectionCriteria criteria) Return an embedding model matching the given criteria.
      EmbeddingModel withDefaultEmbeddingModel()
      abstract PromptRunner withLlm(LlmOptions llm) Get a configurable PromptRunner for this context using the given LLM.
      PromptRunner withLlm(String model) Get a configurable PromptRunner for this context choosing the given model by name and the default LLM options.
      PromptRunner withLlmByRole(String role) Get a configurable PromptRunner for this context choosing the given model by role and the default LLM options.
      PromptRunner withAutoLlm() Get a configurable PromptRunner for this context using automatic model selection criteria.
      PromptRunner withDefaultLlm() Get a configurable PromptRunner for this context using the default model selection criteria.
      PromptRunner withFirstAvailableLlmOf(String llms)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • withEmbeddingModel

         abstract EmbeddingModel withEmbeddingModel(ModelSelectionCriteria criteria)

        Return an embedding model matching the given criteria.

      • withLlm

         abstract PromptRunner withLlm(LlmOptions llm)

        Get a configurable PromptRunner for this context using the given LLM. Allows full control over LLM options.

      • withLlm

         PromptRunner withLlm(String model)

        Get a configurable PromptRunner for this context choosing the given model by name and the default LLM options. Does not allow for any other LLM options to be set.

      • withLlmByRole

         PromptRunner withLlmByRole(String role)

        Get a configurable PromptRunner for this context choosing the given model by role and the default LLM options. Does not allow for any other LLM options to be set. Users must configure roles, for example in application.properties.

      • withAutoLlm

         PromptRunner withAutoLlm()

        Get a configurable PromptRunner for this context using automatic model selection criteria. This may consider prompt and tools, so is not the same as default.

      • withDefaultLlm

         PromptRunner withDefaultLlm()

        Get a configurable PromptRunner for this context using the default model selection criteria.