Skip to content

"Service" keyword is required by configuration #218

@RALIST

Description

@RALIST

According to documentation the basic example of provider's configuration is

development:
  openai:
    access_token: <%= Rails.application.credentials.dig(:openai, :api_key) %>
    model: gpt-4o
    temperature: 0.7
    max_tokens: 4096

but in lib/active_agent/generation_provider.rb:19

 raise "Failed to load provider #{name_or_provider}: configuration not found for provider"  if config["service"].nil?

So basic setup is not working out of the box and failed with error above

 ApplicationAgent.with(message: "Hi!").prompt_context.generate_now.message.content
lib/activeagent/lib/active_agent/generation_provider.rb:19:in 'ActiveAgent::GenerationProvider::ClassMethods#configuration': Failed to load provider openai: configuration not found for provider (RuntimeError)
        from lib/activeagent/lib/active_agent/generation_provider.rb:45:in 'ActiveAgent::GenerationProvider::ClassMethods#generation_provider='
        from lib/activeagent/lib/active_agent/action_prompt/base.rb:109:in 'ActiveAgent::ActionPrompt::Base.generate_with'
        from app/agents/application_agent.rb:2:in '<class:ApplicationAgent>'
        from app/agents/application_agent.rb:1:in '<main>'

I suppose the main reason of using "service" is to later underscore it require "active_agent/generation_provider/#{service_name.underscore}_provider" and made especially for OpenAI provider. Need to change docs or configuration logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions