Skip to content

Commit e8a7f56

Browse files
committed
Fix tests & Cleanups
1 parent 9ae43d9 commit e8a7f56

File tree

133 files changed

+2895
-3658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+2895
-3658
lines changed

README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,24 @@ rails generate active_agent:install
5151

5252
This creates:
5353
- `config/active_agent.yml`: Configuration file for generation providers
54-
- `app/agents`: Directory for your agent classes
55-
- `app/views/agent_*`: Directory for agent prompt/view templates
54+
- `app/agents/application_agent.rb`: Base agent class
5655

5756
### Quick Example
5857

5958
Define an application agent:
6059

6160
```ruby
6261
class ApplicationAgent < ActiveAgent::Base
63-
generate_with :openai,
64-
instructions: "You are a helpful assistant.",
65-
model: "gpt-4o-mini",
66-
temperature: 0.7
62+
generate_with :openai, model: "gpt-4o-mini"
6763
end
6864
```
6965

7066
Use your agent:
7167

7268
```ruby
73-
message = "Test Application Agent"
74-
prompt = ApplicationAgent.with(message: message).prompt_context
75-
response = prompt.generate_now
69+
response = ApplicationAgent.prompt(message: "Hello, world!").generate_now
70+
puts response.message
71+
# => "Hello! How can I help you today?"
7672
```
7773

7874
### Your First Agent
@@ -112,20 +108,17 @@ Configure generation providers in `config/active_agent.yml`:
112108
development:
113109
openai:
114110
service: "OpenAI"
115-
api_key: <%= Rails.application.credentials.dig(:openai, :api_key) %>
111+
access_token: <%= Rails.application.credentials.dig(:openai, :access_token) %>
116112
model: "gpt-4o-mini"
117-
embeddings_model: "text-embedding-3-small"
118113

119114
anthropic:
120115
service: "Anthropic"
121-
api_key: <%= Rails.application.credentials.dig(:anthropic, :api_key) %>
122-
model: "claude-3-5-sonnet"
116+
access_token: <%= Rails.application.credentials.dig(:anthropic, :access_token) %>
117+
model: "claude-sonnet-4.5"
123118

124119
ollama:
125120
service: "Ollama"
126121
model: "llama3.2"
127-
embeddings_model: "nomic-embed-text"
128-
host: "http://localhost:11434/v1"
129122
```
130123
131124
## Features
@@ -165,8 +158,7 @@ Agents can use tools to perform actions:
165158

166159
```ruby
167160
# Agent with tool support
168-
message = "Show me a cat"
169-
prompt = SupportAgent.with(message: message).prompt_context
161+
prompt = SupportAgent.prompt(message: "Show me a cat")
170162
response = prompt.generate_now
171163
# Response includes tool call results
172164
```

docs/.vitepress/config.mts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ export default defineConfig({
6666
text: 'Overview',
6767
link: '/framework',
6868
},
69-
// {
70-
// text: 'Getting Started',
71-
// link: '/getting-started',
72-
// },
69+
{
70+
text: 'Getting Started',
71+
link: '/getting-started',
72+
},
7373
{
7474
text: 'Framework',
7575
items: [

docs/contributing/documentation.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,17 @@ Show multiple related files together:
167167

168168
```markdown
169169
::: code-group
170-
<<< @/../test/docs/examples/translation_agent.rb {ruby:line-numbers}
171-
<<< @/../test/dummy/app/views/translation_agent/translate.json.jbuilder {ruby:line-numbers}
170+
```ruby [translation_agent.rb]
171+
class TranslationAgent < ApplicationAgent
172+
def translate
173+
prompt
174+
end
175+
end
176+
\```
177+
```ruby [translate.json.jbuilder]
178+
json.action_name "translate"
179+
json.message params[:message]
180+
\```
172181
:::
173182
```
174183

@@ -177,7 +186,13 @@ Show multiple related files together:
177186
Display test code alongside its actual result:
178187

179188
```markdown
180-
<<< @/../test/docs/data_extraction_agent_test.rb#extract_data {ruby:line-numbers}
189+
\```ruby
190+
prompt = DataExtractionAgent.with(
191+
image_path: image_path
192+
).parse_content
193+
194+
response = prompt.generate_now
195+
\```
181196

182197
::: details Response
183198
<!-- @include: @/parts/examples/data-extraction-agent-test.rb-test-extract-data.md -->

0 commit comments

Comments
 (0)