airarb 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +12 -0
- data/LICENSE +21 -0
- data/README.md +95 -0
- data/lib/aira/version.rb +3 -0
- data/lib/aira.rb +12 -0
- metadata +63 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 39d7c8b1ce1bd507c844411161b796f712b4ce1dbbdb60f4234955cd04d076da
|
4
|
+
data.tar.gz: b9fd6f26fe3a670fe6b30f02fa8d7f56ba284ef9155ac56657c60c3aa98762a3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 113d9c894d89b565f449d97a9c7cd4230e0e7019507654de41d980ac246944909bad08031d487623dfef350687007a2050ecd8624b7085799be9ae6b39f56324
|
7
|
+
data.tar.gz: 5436a9162a54f3c857ce898d49e0ae7792d02284b3b819a1d294210f60a9945826644cb3925ad39b8359472d9161f9da630ae87ca21263395edc156090e5b3b4
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [0.0.1] - 2024-01-20
|
8
|
+
|
9
|
+
### Added
|
10
|
+
- Initial project setup
|
11
|
+
- Basic project structure
|
12
|
+
- Development documentation
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Michal Czyz
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
# Aidarb - AI Ruby Agent SDK
|
2
|
+
|
3
|
+
> **Note**: This SDK is currently under active development and not ready for production use. Star and watch the repo to stay updated on our progress!
|
4
|
+
|
5
|
+
[](https://badge.fury.io/rb/aidarb)
|
6
|
+
[](https://github.com/cs3b/ai-ruby-agent-sdk/actions)
|
7
|
+
[](https://codeclimate.com/github/cs3b/ai-ruby-agent-sdk/maintainability)
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
9
|
+
|
10
|
+
An elegant Ruby SDK for building AI agents that interact with both LLMs and system tools. The SDK follows a minimalist philosophy focusing on three core components:
|
11
|
+
|
12
|
+
- 🌍 **Environment**: File-based agent communication and queueing
|
13
|
+
- 🛠️ **Tools**: A unified registry for various capabilities (browser control, file operations, etc.)
|
14
|
+
- 💬 **Prompt**: ERB templates for natural Ruby-style prompt interpolation
|
15
|
+
|
16
|
+
## Philosophy
|
17
|
+
|
18
|
+
Not every problem needs an agent. Use agents when tasks are:
|
19
|
+
- Complex with multiple steps
|
20
|
+
- Valuable enough to justify LLM costs
|
21
|
+
- Ambiguous requiring intelligence
|
22
|
+
|
23
|
+
Keep agents simple and focused - this enables faster iteration and better understanding of their behavior.
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
Install the gem and add to the application's Gemfile by executing:
|
28
|
+
|
29
|
+
```bash
|
30
|
+
bundle add aidarb
|
31
|
+
```
|
32
|
+
|
33
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
34
|
+
|
35
|
+
```bash
|
36
|
+
gem install aidarb
|
37
|
+
```
|
38
|
+
|
39
|
+
## Usage
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'aira'
|
43
|
+
|
44
|
+
# Create a web content extractor agent
|
45
|
+
agent :web_extractor do
|
46
|
+
description "Extract main content from a webpage and save as markdown"
|
47
|
+
|
48
|
+
input :url
|
49
|
+
output :markdown_file
|
50
|
+
|
51
|
+
tools :web_browser, :markdown_converter
|
52
|
+
|
53
|
+
prompt <<-ERB
|
54
|
+
Given the URL <%= url %>, extract the main content.
|
55
|
+
Return the result as a markdown document.
|
56
|
+
ERB
|
57
|
+
|
58
|
+
# Optional validation loop
|
59
|
+
loop do |context|
|
60
|
+
File.exist?(context[:markdown_file])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Create a summarization agent
|
65
|
+
agent :summarizer do
|
66
|
+
description "Create a concise summary of markdown content"
|
67
|
+
|
68
|
+
input :markdown_file
|
69
|
+
output :summary
|
70
|
+
|
71
|
+
tools :file_ops
|
72
|
+
|
73
|
+
prompt <<-ERB
|
74
|
+
Read the markdown from <%= markdown_file %>
|
75
|
+
Create a concise summary focusing on key points.
|
76
|
+
ERB
|
77
|
+
end
|
78
|
+
|
79
|
+
# Run the agents in sequence
|
80
|
+
context = {url: "https://example.com/article"}
|
81
|
+
web_extractor.run(context)
|
82
|
+
summarizer.run(context)
|
83
|
+
```
|
84
|
+
|
85
|
+
## Development
|
86
|
+
|
87
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
88
|
+
|
89
|
+
## Contributing
|
90
|
+
|
91
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/cs3b/ai-ruby-agent-sdk.
|
92
|
+
|
93
|
+
## License
|
94
|
+
|
95
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/aira/version.rb
ADDED
data/lib/aira.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "aira/version"
|
4
|
+
# require_relative "aira/dsl"
|
5
|
+
# require_relative "aira/registry"
|
6
|
+
# require_relative "aira/file_queue"
|
7
|
+
# require_relative "aira/tools"
|
8
|
+
# require_relative "aira/prompt"
|
9
|
+
|
10
|
+
module Aira
|
11
|
+
class Error < StandardError; end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: airarb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michal Czyz
|
8
|
+
bindir: bin
|
9
|
+
cert_chain: []
|
10
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: ruby_llm
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0'
|
26
|
+
description: An elegant Ruby SDK for building AI Ruby Agent that interact with both
|
27
|
+
LLMs and system tools
|
28
|
+
email:
|
29
|
+
- opensource@cs3b.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- CHANGELOG.md
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- lib/aira.rb
|
38
|
+
- lib/aira/version.rb
|
39
|
+
homepage: https://github.com/cs3b/ai-ruby-agent-sdk
|
40
|
+
licenses:
|
41
|
+
- MIT
|
42
|
+
metadata:
|
43
|
+
homepage_uri: https://github.com/cs3b/ai-ruby-agent-sdk
|
44
|
+
source_code_uri: https://github.com/cs3b/ai-ruby-agent-sdk
|
45
|
+
changelog_uri: https://github.com/cs3b/ai-ruby-agent-sdk/blob/main/CHANGELOG.md
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.4.0
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubygems_version: 3.6.2
|
61
|
+
specification_version: 4
|
62
|
+
summary: Ruby SDK for building AI agents
|
63
|
+
test_files: []
|