Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
activeagent (0.5.0)
activeagent (0.6.0rc1)
actionpack (>= 7.2, < 9.0)
actionview (>= 7.2, < 9.0)
activejob (>= 7.2, < 9.0)
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default defineConfig({
{
text: 'Generation Providers',
items: [
{ text: 'OpenAI', link: '/docs/generation-providers/openai-provider' },
{ text: 'Anthropic', link: '/docs/generation-providers/anthropic-provider' },
{ text: 'Ollama', link: '/docs/generation-providers/ollama-provider' },
{ text: 'OpenRouter', link: '/docs/generation-providers/open-router-provider' },
]
},
Expand Down
26 changes: 17 additions & 9 deletions docs/docs/action-prompt/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ Active Agent uses Action View to render Message content for [Prompt](./prompts.m
The `prompt` method is used to render the action's content as a message in a prompt. The `prompt` method is similar to `mail` in Action Mailer or `render` in Action Controller, it allows you to specify the content type and view template for the action's response.

```ruby
ApplicationAgent.new.prompt(
content_type: :text, # or :json, :html, etc.
message: "Hello, world!", # The message content to be rendered
messages: [], # Additional messages to include in the prompt context
template_name: "action_template", # The name of the view template to be used
instructions: { template: "instructions" }, # Optional instructions for the prompt generation
actions: [], # Available actions for the agent to use
output_schema: :schema_name # Optional schema for structured output
)
# The prompt method is typically called within an action
class MyAgent < ApplicationAgent
def my_action
prompt(
content_type: :text, # or :json, :html, etc.
message: "Hello, world!", # The message content to be rendered
messages: [], # Additional messages to include in the prompt context
template_name: "action_template", # The name of the view template to be used
instructions: { template: "instructions" }, # Optional instructions for the prompt generation
actions: [], # Available actions for the agent to use
output_schema: :schema_name # Optional schema for structured output
)
end
end

# To use the agent with parameters:
MyAgent.with(param: value).my_action.generate_now
```

These Prompt objects contain the context Messages and available Actions. These actions are the interface that agents can use to interact with tools through text and JSON views or interact with users through text and HTML views.
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/framework/generation-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,8 @@ For a complete example showing all three levels working together, see:

For detailed documentation on specific providers and their features:

- [OpenAI Provider](/docs/generation-providers/openai-provider) - GPT-4, GPT-3.5, function calling, vision, and Azure OpenAI support
- [Anthropic Provider](/docs/generation-providers/anthropic-provider) - Claude 3.5 and Claude 3 models with extended context windows
- [Ollama Provider](/docs/generation-providers/ollama-provider) - Local LLM inference for privacy-sensitive applications
- [OpenRouter Provider](/docs/generation-providers/open-router-provider) - Multi-model routing with fallbacks, PDF processing, and vision support

18 changes: 16 additions & 2 deletions docs/docs/framework/rails-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,22 @@ You can pass messages to the agent from Action Controller, and the agent render
```ruby
class MessagesController < ApplicationController
def create
@agent = TravelAgent.with(messages: params[:messages]).generate_later
render json: @agent.response
# Use the class method with() to pass parameters, then call the action
generation = TravelAgent.with(message: params[:message]).prompt_context.generate_later

# The generation object tracks the async job
render json: { job_id: generation.job_id }
end

def show
# Check status of a generation
generation = ActiveAgent::Generation.find(params[:id])

if generation.finished?
render json: { response: generation.response.message.content }
else
render json: { status: "processing" }
end
end
end
```
Expand Down
Loading