intelli_agent 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/intelli_agent/openai.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e54e7e019c57ad7e17a50264d734c159db622dffb08061b5a272641ab7e5a99
|
4
|
+
data.tar.gz: 0e97fcfd1a8feffbdfbbf072b463616d24071ee248a507a706e4d67876597104
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09e61137807a651493053efe64017962fd262595b66230627147f8cb394c6f2dd9dfc6a6e992067e65662f584e6c109f46374d2f7d677fcf10b24a21914b4c41'
|
7
|
+
data.tar.gz: 3de2b502fa1cd60094e465d3cef74f58ce1ea31f704293628afbfbf5ce8350c45bfe3132eebec498fd1f674a320cc950901465e1881dea472ea5367e3e70722c
|
data/lib/intelli_agent/openai.rb
CHANGED
@@ -73,15 +73,15 @@ module IntelliAgent::OpenAI
|
|
73
73
|
response
|
74
74
|
end
|
75
75
|
|
76
|
-
def self.single_prompt(prompt:, model: :gpt_basic, response_format: nil, max_tokens: MAX_TOKENS, store: true, tools: nil, auto_run_functions: false, function_context: nil)
|
76
|
+
def self.single_prompt(prompt:, model: :gpt_basic, response_format: nil, max_tokens: MAX_TOKENS, store: true, metadata: nil, tools: nil, auto_run_functions: false, function_context: nil)
|
77
77
|
chat(messages: [{ user: prompt }], model:, response_format:, max_tokens:, store:, tools:, auto_run_functions:, function_context:)
|
78
78
|
end
|
79
79
|
|
80
|
-
def self.single_chat(system:, user:, model: :gpt_basic, response_format: nil, max_tokens: MAX_TOKENS, store: true, tools: nil, auto_run_functions: false, function_context: nil)
|
80
|
+
def self.single_chat(system:, user:, model: :gpt_basic, response_format: nil, max_tokens: MAX_TOKENS, store: true, metadata: nil, tools: nil, auto_run_functions: false, function_context: nil)
|
81
81
|
chat(messages: [{ system: }, { user: }], model:, response_format:, max_tokens:, store:, tools:, auto_run_functions:, function_context:)
|
82
82
|
end
|
83
83
|
|
84
|
-
def self.chat(messages:, model: :gpt_basic, response_format: nil, max_tokens: MAX_TOKENS, store: true, tools: nil, auto_run_functions: false, function_context: nil)
|
84
|
+
def self.chat(messages:, model: :gpt_basic, response_format: nil, max_tokens: MAX_TOKENS, store: true, metadata: nil, tools: nil, auto_run_functions: false, function_context: nil)
|
85
85
|
model = select_model(model)
|
86
86
|
|
87
87
|
# o1 models doesn't support max_tokens, instead max_completion_tokens
|
@@ -91,7 +91,8 @@ module IntelliAgent::OpenAI
|
|
91
91
|
messages = parse_messages(messages)
|
92
92
|
|
93
93
|
parameters = { model:, messages:, store: }
|
94
|
-
|
94
|
+
parameters[:metadata] = metadata if metadata
|
95
|
+
|
95
96
|
parameters[:max_completion_tokens] = max_completion_tokens if is_o1_model
|
96
97
|
parameters[:max_tokens] = max_completion_tokens unless is_o1_model
|
97
98
|
|