autoflux-openai 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 805cad0d30d93ebd6ab10fcf7b093cee81b7c3ef24dae357041cc91537c93f60
4
- data.tar.gz: 317759138e823d94021e4b3d972a6f3a8e9a80932910e6637263437d8d04aad6
3
+ metadata.gz: e645074c500ce6b5ad07961575ac7dbbdb7ef71e7aa2ab43cf4e64c2bf7e1803
4
+ data.tar.gz: 4f490577cce14147d94dc9da67f8daeb21d73331c719495f581a6ce21427f320
5
5
  SHA512:
6
- metadata.gz: 89362f8361df4892e6d530bc9d441380424fde7b42032b7e82a7151ae1b067deac046083fd7163d9b5a8c5e5ea6b047720975528cf098eb5a1d0b7b23d9977b4
7
- data.tar.gz: d00d8dbfabca33ddb7cf1c7d8b461d50cbcfa8afdf0a73b76e88d345def96cbd7bcc3907862021a00b840f1dc8f148812f040730565535bfe3cc1c851dfe40c9
6
+ metadata.gz: e33369742bb10fc82baa2a0b64cac4a631f231143412ac7f87e55beeab4e6cc8d8b9d4449f756bafaa1f9facec416726d5113d42132b6498cd5eee068a2d3f90
7
+ data.tar.gz: e837e78f01bbd99dc26ab5c93cd4f269ed0dcf507de5c1062cefc9516b2aacb0362f94d56b44a1a4c510f1cfeee636e6e6272b15ca75fac147605f4ca0c0fb56
data/README.md CHANGED
@@ -27,7 +27,15 @@ res = agent.call("Hello, world!")
27
27
  # => "Hello, world!" from OpenAI
28
28
  ```
29
29
 
30
- > The agent will return `content` from the as the interface of the `autoflux` agent.
30
+ > The agent will return `content` from the response as the interface of the `autoflux` agent.
31
+
32
+ If you want to use as multi agents the agent name can be set.
33
+
34
+ ```ruby
35
+ agent = Autoflux::OpenAI::Agent.new(name: "shopping", model: "gpt-4o-mini")
36
+ res = agent.call("Hello, world!")
37
+ # => "Hello, world!" from OpenAI
38
+ ```
31
39
 
32
40
  ### Tool
33
41
 
@@ -4,11 +4,14 @@ module Autoflux
4
4
  module OpenAI
5
5
  # The agent is design to use OpenAI as an agent
6
6
  class Agent
7
- attr_reader :model, :memory
7
+ DEFAULT_NAME = "openai"
8
8
 
9
- def initialize(model:, client: Client.new, tools: [], memory: [])
9
+ attr_reader :name, :model, :memory
10
+
11
+ def initialize(model:, name: DEFAULT_NAME, client: Client.new, tools: [], memory: [])
10
12
  @client = client
11
13
  @model = model
14
+ @name = name
12
15
  @memory = memory
13
16
  @_tools = tools
14
17
  end
@@ -6,7 +6,7 @@ module Autoflux
6
6
  class Tool
7
7
  attr_reader :name, :description, :parameters
8
8
 
9
- def initialize(name:, description:, parameters: [], &executor)
9
+ def initialize(name:, description:, parameters: nil, &executor)
10
10
  @name = name
11
11
  @description = description
12
12
  @parameters = parameters
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Autoflux
4
4
  module OpenAI
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -5,12 +5,15 @@ module Autoflux
5
5
 
6
6
  # The agent is design to use OpenAI as an agent
7
7
  class Agent
8
+ DEFAULT_NAME: "openai"
9
+
8
10
  @client: Client
9
11
  @model: String
12
+ @name: String
10
13
  @memory: _Memory
11
14
  @_tools: Array[_Tool]
12
15
 
13
- def initialize: (model: String, ?client: Client, ?memory: _Memory) -> void
16
+ def initialize: (model: String, ?name: String, ?client: Client, ?memory: _Memory) -> void
14
17
  def call: (String prompt, **untyped context) -> _ToS
15
18
  def use: (toolCall call, **untyped context) -> _ToJson
16
19
  def complete: () -> agentResponse
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoflux-openai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aotokitsuruya