Class CompatOAIModel

java.lang.Object
com.google.genkit.plugins.compatoai.CompatOAIModel
All Implemented Interfaces:
Model, Action<ModelRequest,ModelResponse,ModelResponseChunk>, Registerable

public class CompatOAIModel extends Object implements Model
OpenAI-compatible API model implementation for Genkit. This implementation can be used by any provider that offers an OpenAI-compatible API endpoint.
  • Constructor Details

    • CompatOAIModel

      public CompatOAIModel(String modelName, String apiModelName, String label, CompatOAIPluginOptions options)
      Creates a new CompatOAIModel with separate Genkit and API model names.
      Parameters:
      modelName - the Genkit model name (e.g., "groq/llama-3.3-70b-versatile")
      apiModelName - the API model name (e.g., "llama-3.3-70b-versatile")
      label - the display label (e.g., "Groq llama-3.3-70b-versatile")
      options - the plugin options
    • CompatOAIModel

      public CompatOAIModel(String modelName, String label, CompatOAIPluginOptions options)
      Creates a new CompatOAIModel (backward compatible - uses modelName for both).
      Parameters:
      modelName - the model name (e.g., "gpt-4", "grok-beta")
      label - the display label (e.g., "XAI grok-beta")
      options - the plugin options
  • Method Details