intelli_agent 0.0.1 → 0.0.2

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: 3fca7e6fcb2e2360ccd76c9d09506f73db72dd525dfd771322a19a6982eedd52
4
- data.tar.gz: 2bcb9b1cc62b6dfb9a6c4ecc634dab04e9c1c27a2941dd2feb6a0f8aad858934
3
+ metadata.gz: f1af98056d1cfee93c37a849051ec08bbd94ff1b08e06c51df43459d0da2b39f
4
+ data.tar.gz: 558d8b96efc731bb945d73a3d107a017147be910d57fcde9b9e84e0e20fcd42b
5
5
  SHA512:
6
- metadata.gz: 3de9eaddade5b5d5f16e385ef4cbff9bd7e7eade087b4bbc04c5c8ae2c3d0cc15ef79b518536d023f3153b62a4b748e53f735b7f33a338450db403d824c86f06
7
- data.tar.gz: aa27675fcfc8c0bcab9701b1f0e8ca6ec09eb03f8c4fd141b9c0b63465c196f9bfcf85ad8c401eeb2c32e82930f310c3ae0fbac445f43f1e5d4dd6aa6c1622e7
6
+ metadata.gz: 1a59b52b56baea277a307efc5d9fa6b6f209292fec80842378001f2394084e1db3b2ee4e47d197aa75366e7da85b9941885566e67ccd26de03069f0a64582427
7
+ data.tar.gz: a0779b693af7c7ac8856f1fae3dbdb91bb0ceceef1cb3e70c97b675dc47f1d60f22ece30e6447ff7a7a3ff9ed40abc99a96ce6768c169a2f3dbe6d81f3998e5e
@@ -1,10 +1,14 @@
1
- class AI::Agent
1
+ #require_relative './intelli_agent/ai'
2
+ require 'intelli_agent/ai'
3
+
4
+ class IntelliAgent
5
+ extend AI
2
6
  attr_reader :assistant, :thread, :instructions, :vector_store_id
3
7
 
4
8
  def initialize(assistant_id: nil, thread_id: nil, thread_instructions: nil, vector_store_id: nil)
5
9
  @openai_client = OpenAI::Client.new
6
10
 
7
- assistant_id ||= ENV.fetch('OPENAI_AKAPU_CORE_ASSISTANT_ID')
11
+ assistant_id ||= ENV.fetch('OPENAI_ASSISTANT_ID')
8
12
  @assistant = @openai_client.assistants.retrieve(id: assistant_id)
9
13
 
10
14
  thread_params = {}
@@ -19,17 +23,10 @@ class AI::Agent
19
23
  @instructions = thread_instructions || @assistant['instructions']
20
24
  end
21
25
 
22
- def add_message(text, role: 'user')
23
- @openai_client.messages.create(thread_id: @thread['id'], parameters: { role: role, content: text })
24
- end
25
-
26
- def messages
27
- @openai_client.messages.list(thread_id: @thread['id'])
28
- end
29
-
30
- def last_message
31
- messages['data'].first['content'].first['text']['value']
32
- end
26
+ def add_message(text, role: 'user') = @openai_client.messages.create(thread_id: @thread['id'], parameters: { role: role, content: text })
27
+ def messages = @openai_client.messages.list(thread_id: @thread['id'])
28
+ def last_message = messages['data'].first['content'].first['text']['value']
29
+ def runs = @openai_client.runs.list(thread_id: @thread['id'])
33
30
 
34
31
  def run(instructions: nil, additional_instructions: nil, additional_message: nil, model: nil, tool_choice: nil)
35
32
  params = { assistant_id: @assistant['id'] }
@@ -64,8 +61,4 @@ class AI::Agent
64
61
  end
65
62
  end
66
63
  end
67
-
68
- def runs
69
- @openai_client.runs.list(thread_id: @thread['id'])
70
- end
71
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intelli_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gedean Dias
@@ -31,12 +31,9 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - README.md
34
- - lib/ai.rb
35
- - lib/ai.rb:Zone.Identifier
36
- - lib/ai/agent.rb
37
- - lib/ai/agent.rb:Zone.Identifier
38
- - lib/ai/agent_test.rb_
39
- - lib/ai/agent_test.rb_:Zone.Identifier
34
+ - lib/intelli_agent.rb
35
+ - lib/intelli_agent/agent_test.rb_
36
+ - lib/intelli_agent/ai.rb
40
37
  homepage: https://github.com/gedean/intelli_agent
41
38
  licenses:
42
39
  - MIT
File without changes
File without changes
File without changes
File without changes
File without changes