mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 21:15:19 +02:00
improvements(ai): Improve AI streaming UI/UX interactions + better separation of AI provider responsibilities (#2039)
* Start refactor * Interface updates * Rework Assistant, Provider, and tests for better domain boundaries * Consolidate and simplify OpenAI provider and provider concepts * Clean up assistant streaming * Improve assistant message orchestration logic * Clean up "thinking" UI interactions * Remove stale class * Regenerate VCR test responses
This commit is contained in:
parent
6331788b33
commit
5cf758bd03
33 changed files with 1179 additions and 624 deletions
|
@ -1,5 +1,4 @@
|
|||
require "test_helper"
|
||||
require "ostruct"
|
||||
|
||||
class AssistantTest < ActiveSupport::TestCase
|
||||
include ProviderTestHelper
|
||||
|
@ -8,74 +7,109 @@ class AssistantTest < ActiveSupport::TestCase
|
|||
@chat = chats(:two)
|
||||
@message = @chat.messages.create!(
|
||||
type: "UserMessage",
|
||||
content: "Help me with my finances",
|
||||
content: "What is my net worth?",
|
||||
ai_model: "gpt-4o"
|
||||
)
|
||||
@assistant = Assistant.for_chat(@chat)
|
||||
@provider = mock
|
||||
@assistant.expects(:get_model_provider).with("gpt-4o").returns(@provider)
|
||||
end
|
||||
|
||||
test "responds to basic prompt" do
|
||||
text_chunk = OpenStruct.new(type: "output_text", data: "Hello from assistant")
|
||||
response_chunk = OpenStruct.new(
|
||||
type: "response",
|
||||
data: OpenStruct.new(
|
||||
id: "1",
|
||||
model: "gpt-4o",
|
||||
messages: [
|
||||
OpenStruct.new(
|
||||
id: "1",
|
||||
content: "Hello from assistant",
|
||||
)
|
||||
],
|
||||
functions: []
|
||||
)
|
||||
)
|
||||
test "errors get added to chat" do
|
||||
@assistant.expects(:get_model_provider).with("gpt-4o").returns(@provider)
|
||||
|
||||
@provider.expects(:chat_response).with do |message, **options|
|
||||
options[:streamer].call(text_chunk)
|
||||
options[:streamer].call(response_chunk)
|
||||
true
|
||||
end
|
||||
error = StandardError.new("test error")
|
||||
@provider.expects(:chat_response).returns(provider_error_response(error))
|
||||
|
||||
assert_difference "AssistantMessage.count", 1 do
|
||||
@chat.expects(:add_error).with(error).once
|
||||
|
||||
assert_no_difference "AssistantMessage.count" do
|
||||
@assistant.respond_to(@message)
|
||||
end
|
||||
end
|
||||
|
||||
test "responds with tool function calls" do
|
||||
function_request_chunk = OpenStruct.new(type: "function_request", data: "get_net_worth")
|
||||
text_chunk = OpenStruct.new(type: "output_text", data: "Your net worth is $124,200")
|
||||
response_chunk = OpenStruct.new(
|
||||
type: "response",
|
||||
data: OpenStruct.new(
|
||||
id: "1",
|
||||
model: "gpt-4o",
|
||||
messages: [
|
||||
OpenStruct.new(
|
||||
id: "1",
|
||||
content: "Your net worth is $124,200",
|
||||
)
|
||||
],
|
||||
functions: [
|
||||
OpenStruct.new(
|
||||
id: "1",
|
||||
call_id: "1",
|
||||
name: "get_net_worth",
|
||||
arguments: "{}",
|
||||
result: "$124,200"
|
||||
)
|
||||
]
|
||||
)
|
||||
test "responds to basic prompt" do
|
||||
@assistant.expects(:get_model_provider).with("gpt-4o").returns(@provider)
|
||||
|
||||
text_chunks = [
|
||||
provider_text_chunk("I do not "),
|
||||
provider_text_chunk("have the information "),
|
||||
provider_text_chunk("to answer that question")
|
||||
]
|
||||
|
||||
response_chunk = provider_response_chunk(
|
||||
id: "1",
|
||||
model: "gpt-4o",
|
||||
messages: [ provider_message(id: "1", text: text_chunks.join) ],
|
||||
function_requests: []
|
||||
)
|
||||
|
||||
response = provider_success_response(response_chunk.data)
|
||||
|
||||
@provider.expects(:chat_response).with do |message, **options|
|
||||
options[:streamer].call(function_request_chunk)
|
||||
options[:streamer].call(text_chunk)
|
||||
text_chunks.each do |text_chunk|
|
||||
options[:streamer].call(text_chunk)
|
||||
end
|
||||
|
||||
options[:streamer].call(response_chunk)
|
||||
true
|
||||
end.returns(response)
|
||||
|
||||
assert_difference "AssistantMessage.count", 1 do
|
||||
@assistant.respond_to(@message)
|
||||
message = @chat.messages.ordered.where(type: "AssistantMessage").last
|
||||
assert_equal "I do not have the information to answer that question", message.content
|
||||
assert_equal 0, message.tool_calls.size
|
||||
end
|
||||
end
|
||||
|
||||
test "responds with tool function calls" do
|
||||
@assistant.expects(:get_model_provider).with("gpt-4o").returns(@provider).once
|
||||
|
||||
# Only first provider call executes function
|
||||
Assistant::Function::GetAccounts.any_instance.stubs(:call).returns("test value").once
|
||||
|
||||
# Call #1: Function requests
|
||||
call1_response_chunk = provider_response_chunk(
|
||||
id: "1",
|
||||
model: "gpt-4o",
|
||||
messages: [],
|
||||
function_requests: [
|
||||
provider_function_request(id: "1", call_id: "1", function_name: "get_accounts", function_args: "{}")
|
||||
]
|
||||
)
|
||||
|
||||
call1_response = provider_success_response(call1_response_chunk.data)
|
||||
|
||||
# Call #2: Text response (that uses function results)
|
||||
call2_text_chunks = [
|
||||
provider_text_chunk("Your net worth is "),
|
||||
provider_text_chunk("$124,200")
|
||||
]
|
||||
|
||||
call2_response_chunk = provider_response_chunk(
|
||||
id: "2",
|
||||
model: "gpt-4o",
|
||||
messages: [ provider_message(id: "1", text: call2_text_chunks.join) ],
|
||||
function_requests: []
|
||||
)
|
||||
|
||||
call2_response = provider_success_response(call2_response_chunk.data)
|
||||
|
||||
sequence = sequence("provider_chat_response")
|
||||
|
||||
@provider.expects(:chat_response).with do |message, **options|
|
||||
call2_text_chunks.each do |text_chunk|
|
||||
options[:streamer].call(text_chunk)
|
||||
end
|
||||
|
||||
options[:streamer].call(call2_response_chunk)
|
||||
true
|
||||
end.returns(call2_response).once.in_sequence(sequence)
|
||||
|
||||
@provider.expects(:chat_response).with do |message, **options|
|
||||
options[:streamer].call(call1_response_chunk)
|
||||
true
|
||||
end.returns(call1_response).once.in_sequence(sequence)
|
||||
|
||||
assert_difference "AssistantMessage.count", 1 do
|
||||
@assistant.respond_to(@message)
|
||||
|
@ -83,4 +117,34 @@ class AssistantTest < ActiveSupport::TestCase
|
|||
assert_equal 1, message.tool_calls.size
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def provider_function_request(id:, call_id:, function_name:, function_args:)
|
||||
Provider::LlmConcept::ChatFunctionRequest.new(
|
||||
id: id,
|
||||
call_id: call_id,
|
||||
function_name: function_name,
|
||||
function_args: function_args
|
||||
)
|
||||
end
|
||||
|
||||
def provider_message(id:, text:)
|
||||
Provider::LlmConcept::ChatMessage.new(id: id, output_text: text)
|
||||
end
|
||||
|
||||
def provider_text_chunk(text)
|
||||
Provider::LlmConcept::ChatStreamChunk.new(type: "output_text", data: text)
|
||||
end
|
||||
|
||||
def provider_response_chunk(id:, model:, messages:, function_requests:)
|
||||
Provider::LlmConcept::ChatStreamChunk.new(
|
||||
type: "response",
|
||||
data: Provider::LlmConcept::ChatResponse.new(
|
||||
id: id,
|
||||
model: model,
|
||||
messages: messages,
|
||||
function_requests: function_requests
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,16 +6,11 @@ class Provider::OpenaiTest < ActiveSupport::TestCase
|
|||
setup do
|
||||
@subject = @openai = Provider::Openai.new(ENV.fetch("OPENAI_ACCESS_TOKEN", "test-openai-token"))
|
||||
@subject_model = "gpt-4o"
|
||||
@chat = chats(:two)
|
||||
end
|
||||
|
||||
test "openai errors are automatically raised" do
|
||||
VCR.use_cassette("openai/chat/error") do
|
||||
response = @openai.chat_response(UserMessage.new(
|
||||
chat: @chat,
|
||||
content: "Error test",
|
||||
ai_model: "invalid-model-that-will-trigger-api-error"
|
||||
))
|
||||
response = @openai.chat_response("Test", model: "invalid-model-that-will-trigger-api-error")
|
||||
|
||||
assert_not response.success?
|
||||
assert_kind_of Provider::Openai::Error, response.error
|
||||
|
@ -24,113 +19,145 @@ class Provider::OpenaiTest < ActiveSupport::TestCase
|
|||
|
||||
test "basic chat response" do
|
||||
VCR.use_cassette("openai/chat/basic_response") do
|
||||
message = @chat.messages.create!(
|
||||
type: "UserMessage",
|
||||
content: "This is a chat test. If it's working, respond with a single word: Yes",
|
||||
ai_model: @subject_model
|
||||
response = @subject.chat_response(
|
||||
"This is a chat test. If it's working, respond with a single word: Yes",
|
||||
model: @subject_model
|
||||
)
|
||||
|
||||
response = @subject.chat_response(message)
|
||||
|
||||
assert response.success?
|
||||
assert_equal 1, response.data.messages.size
|
||||
assert_includes response.data.messages.first.content, "Yes"
|
||||
assert_includes response.data.messages.first.output_text, "Yes"
|
||||
end
|
||||
end
|
||||
|
||||
test "streams basic chat response" do
|
||||
VCR.use_cassette("openai/chat/basic_response") do
|
||||
VCR.use_cassette("openai/chat/basic_streaming_response") do
|
||||
collected_chunks = []
|
||||
|
||||
mock_streamer = proc do |chunk|
|
||||
collected_chunks << chunk
|
||||
end
|
||||
|
||||
message = @chat.messages.create!(
|
||||
type: "UserMessage",
|
||||
content: "This is a chat test. If it's working, respond with a single word: Yes",
|
||||
ai_model: @subject_model
|
||||
response = @subject.chat_response(
|
||||
"This is a chat test. If it's working, respond with a single word: Yes",
|
||||
model: @subject_model,
|
||||
streamer: mock_streamer
|
||||
)
|
||||
|
||||
@subject.chat_response(message, streamer: mock_streamer)
|
||||
|
||||
tool_call_chunks = collected_chunks.select { |chunk| chunk.type == "function_request" }
|
||||
text_chunks = collected_chunks.select { |chunk| chunk.type == "output_text" }
|
||||
response_chunks = collected_chunks.select { |chunk| chunk.type == "response" }
|
||||
|
||||
assert_equal 1, text_chunks.size
|
||||
assert_equal 1, response_chunks.size
|
||||
assert_equal 0, tool_call_chunks.size
|
||||
assert_equal "Yes", text_chunks.first.data
|
||||
assert_equal "Yes", response_chunks.first.data.messages.first.content
|
||||
assert_equal "Yes", response_chunks.first.data.messages.first.output_text
|
||||
assert_equal response_chunks.first.data, response.data
|
||||
end
|
||||
end
|
||||
|
||||
test "chat response with tool calls" do
|
||||
VCR.use_cassette("openai/chat/tool_calls") do
|
||||
response = @subject.chat_response(
|
||||
tool_call_message,
|
||||
test "chat response with function calls" do
|
||||
VCR.use_cassette("openai/chat/function_calls") do
|
||||
prompt = "What is my net worth?"
|
||||
|
||||
functions = [
|
||||
{
|
||||
name: "get_net_worth",
|
||||
description: "Gets a user's net worth",
|
||||
params_schema: { type: "object", properties: {}, required: [], additionalProperties: false },
|
||||
strict: true
|
||||
}
|
||||
]
|
||||
|
||||
first_response = @subject.chat_response(
|
||||
prompt,
|
||||
model: @subject_model,
|
||||
instructions: "Use the tools available to you to answer the user's question.",
|
||||
available_functions: [ PredictableToolFunction.new(@chat) ]
|
||||
functions: functions
|
||||
)
|
||||
|
||||
assert response.success?
|
||||
assert_equal 1, response.data.functions.size
|
||||
assert_equal 1, response.data.messages.size
|
||||
assert_includes response.data.messages.first.content, PredictableToolFunction.expected_test_result
|
||||
assert first_response.success?
|
||||
|
||||
function_request = first_response.data.function_requests.first
|
||||
|
||||
assert function_request.present?
|
||||
|
||||
second_response = @subject.chat_response(
|
||||
prompt,
|
||||
model: @subject_model,
|
||||
function_results: [ {
|
||||
call_id: function_request.call_id,
|
||||
output: { amount: 10000, currency: "USD" }.to_json
|
||||
} ],
|
||||
previous_response_id: first_response.data.id
|
||||
)
|
||||
|
||||
assert second_response.success?
|
||||
assert_equal 1, second_response.data.messages.size
|
||||
assert_includes second_response.data.messages.first.output_text, "$10,000"
|
||||
end
|
||||
end
|
||||
|
||||
test "streams chat response with tool calls" do
|
||||
VCR.use_cassette("openai/chat/tool_calls") do
|
||||
test "streams chat response with function calls" do
|
||||
VCR.use_cassette("openai/chat/streaming_function_calls") do
|
||||
collected_chunks = []
|
||||
|
||||
mock_streamer = proc do |chunk|
|
||||
collected_chunks << chunk
|
||||
end
|
||||
|
||||
prompt = "What is my net worth?"
|
||||
|
||||
functions = [
|
||||
{
|
||||
name: "get_net_worth",
|
||||
description: "Gets a user's net worth",
|
||||
params_schema: { type: "object", properties: {}, required: [], additionalProperties: false },
|
||||
strict: true
|
||||
}
|
||||
]
|
||||
|
||||
# Call #1: First streaming call, will return a function request
|
||||
@subject.chat_response(
|
||||
tool_call_message,
|
||||
prompt,
|
||||
model: @subject_model,
|
||||
instructions: "Use the tools available to you to answer the user's question.",
|
||||
available_functions: [ PredictableToolFunction.new(@chat) ],
|
||||
functions: functions,
|
||||
streamer: mock_streamer
|
||||
)
|
||||
|
||||
text_chunks = collected_chunks.select { |chunk| chunk.type == "output_text" }
|
||||
text_chunks = collected_chunks.select { |chunk| chunk.type == "output_text" }
|
||||
tool_call_chunks = collected_chunks.select { |chunk| chunk.type == "function_request" }
|
||||
response_chunks = collected_chunks.select { |chunk| chunk.type == "response" }
|
||||
|
||||
assert_equal 1, tool_call_chunks.count
|
||||
assert text_chunks.count >= 1
|
||||
assert_equal 1, response_chunks.count
|
||||
assert_equal 0, text_chunks.size
|
||||
assert_equal 1, response_chunks.size
|
||||
|
||||
assert_includes response_chunks.first.data.messages.first.content, PredictableToolFunction.expected_test_result
|
||||
first_response = response_chunks.first.data
|
||||
function_request = first_response.function_requests.first
|
||||
|
||||
# Reset collected chunks for the second call
|
||||
collected_chunks = []
|
||||
|
||||
# Call #2: Second streaming call, will return a function result
|
||||
@subject.chat_response(
|
||||
prompt,
|
||||
model: @subject_model,
|
||||
function_results: [
|
||||
{
|
||||
call_id: function_request.call_id,
|
||||
output: { amount: 10000, currency: "USD" }
|
||||
}
|
||||
],
|
||||
previous_response_id: first_response.id,
|
||||
streamer: mock_streamer
|
||||
)
|
||||
|
||||
text_chunks = collected_chunks.select { |chunk| chunk.type == "output_text" }
|
||||
response_chunks = collected_chunks.select { |chunk| chunk.type == "response" }
|
||||
|
||||
assert text_chunks.size >= 1
|
||||
assert_equal 1, response_chunks.size
|
||||
|
||||
assert_includes response_chunks.first.data.messages.first.output_text, "$10,000"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def tool_call_message
|
||||
UserMessage.new(chat: @chat, content: "What is my net worth?", ai_model: @subject_model)
|
||||
end
|
||||
|
||||
class PredictableToolFunction < Assistant::Function
|
||||
class << self
|
||||
def expected_test_result
|
||||
"$124,200"
|
||||
end
|
||||
|
||||
def name
|
||||
"get_net_worth"
|
||||
end
|
||||
|
||||
def description
|
||||
"Gets user net worth data"
|
||||
end
|
||||
end
|
||||
|
||||
def call(params = {})
|
||||
self.class.expected_test_result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ http_interactions:
|
|||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"model":"gpt-4o","input":[{"role":"user","content":"This is a chat
|
||||
test. If it''s working, respond with a single word: Yes"}],"instructions":null,"tools":[],"previous_response_id":null,"stream":true}'
|
||||
test. If it''s working, respond with a single word: Yes"}],"instructions":null,"tools":[],"previous_response_id":null,"stream":null}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
|
@ -24,9 +24,9 @@ http_interactions:
|
|||
message: OK
|
||||
headers:
|
||||
Date:
|
||||
- Wed, 26 Mar 2025 21:27:38 GMT
|
||||
- Mon, 31 Mar 2025 20:38:55 GMT
|
||||
Content-Type:
|
||||
- text/event-stream; charset=utf-8
|
||||
- application/json
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Connection:
|
||||
|
@ -36,57 +36,85 @@ http_interactions:
|
|||
Openai-Organization:
|
||||
- "<OPENAI_ORGANIZATION_ID>"
|
||||
X-Request-Id:
|
||||
- req_8fce503a4c5be145dda20867925b1622
|
||||
- req_f99033a5841a7d9357ee08d301ad634e
|
||||
Openai-Processing-Ms:
|
||||
- '103'
|
||||
- '713'
|
||||
Strict-Transport-Security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
Cf-Cache-Status:
|
||||
- DYNAMIC
|
||||
Set-Cookie:
|
||||
- __cf_bm=o5kysxtwKJs3TPoOquM0X4MkyLIaylWhRd8LhagxXck-1743024458-1.0.1.1-ol6ndVCx6dHLGnc9.YmKYwgfOBqhSZSBpIHg4STCi4OBhrgt70FYPmMptrYDvg.SoFuS5RAS_pGiNNWXHspHio3gTfJ87vIdT936GYHIDrc;
|
||||
path=/; expires=Wed, 26-Mar-25 21:57:38 GMT; domain=.api.openai.com; HttpOnly;
|
||||
- __cf_bm=UOaolWyAE3WXhLfg9c3KmO4d_Nq6t9cedTfZ6hznYEE-1743453535-1.0.1.1-GyQq_xeRpsyxxp8QQja5Bvo2XqUGfXHNGehtQoPV.BIgyLbERSIqJAK0IEKcYgpuLCyvQdlMNGqtdBHB6r5XMPHjOSMN1bTQYJHLsvlD5Z4;
|
||||
path=/; expires=Mon, 31-Mar-25 21:08:55 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=Iqk8pY6uwz2lLhdKt0PwWTdtYQUqqvS6xmP9DMVko2A-1743024458829-0.0.1.1-604800000;
|
||||
- _cfuvid=_zDj2dj75eLeGSzZxpBpzHxYg4gJpEfQpcnT9aCJXqM-1743453535930-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
Server:
|
||||
- cloudflare
|
||||
Cf-Ray:
|
||||
- 9269bbb21b1ecf43-CMH
|
||||
- 9292a7325d09cf53-CMH
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=86400
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: |+
|
||||
event: response.created
|
||||
data: {"type":"response.created","response":{"id":"resp_67e4714ab0148192ae2cc4303794d6fc0c1a792abcdc2819","object":"response","created_at":1743024458,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.in_progress
|
||||
data: {"type":"response.in_progress","response":{"id":"resp_67e4714ab0148192ae2cc4303794d6fc0c1a792abcdc2819","object":"response","created_at":1743024458,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.output_item.added
|
||||
data: {"type":"response.output_item.added","output_index":0,"item":{"type":"message","id":"msg_67e4714b1f8c8192b9b16febe8be86550c1a792abcdc2819","status":"in_progress","role":"assistant","content":[]}}
|
||||
|
||||
event: response.content_part.added
|
||||
data: {"type":"response.content_part.added","item_id":"msg_67e4714b1f8c8192b9b16febe8be86550c1a792abcdc2819","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e4714b1f8c8192b9b16febe8be86550c1a792abcdc2819","output_index":0,"content_index":0,"delta":"Yes"}
|
||||
|
||||
event: response.output_text.done
|
||||
data: {"type":"response.output_text.done","item_id":"msg_67e4714b1f8c8192b9b16febe8be86550c1a792abcdc2819","output_index":0,"content_index":0,"text":"Yes"}
|
||||
|
||||
event: response.content_part.done
|
||||
data: {"type":"response.content_part.done","item_id":"msg_67e4714b1f8c8192b9b16febe8be86550c1a792abcdc2819","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Yes","annotations":[]}}
|
||||
|
||||
event: response.output_item.done
|
||||
data: {"type":"response.output_item.done","output_index":0,"item":{"type":"message","id":"msg_67e4714b1f8c8192b9b16febe8be86550c1a792abcdc2819","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Yes","annotations":[]}]}}
|
||||
|
||||
event: response.completed
|
||||
data: {"type":"response.completed","response":{"id":"resp_67e4714ab0148192ae2cc4303794d6fc0c1a792abcdc2819","object":"response","created_at":1743024458,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[{"type":"message","id":"msg_67e4714b1f8c8192b9b16febe8be86550c1a792abcdc2819","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Yes","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":43,"input_tokens_details":{"cached_tokens":0},"output_tokens":2,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":45},"user":null,"metadata":{}}}
|
||||
|
||||
recorded_at: Wed, 26 Mar 2025 21:27:39 GMT
|
||||
encoding: ASCII-8BIT
|
||||
string: |-
|
||||
{
|
||||
"id": "resp_67eafd5f2b7c81928d6834e7f4d26deb0bfadc995fda2b45",
|
||||
"object": "response",
|
||||
"created_at": 1743453535,
|
||||
"status": "completed",
|
||||
"error": null,
|
||||
"incomplete_details": null,
|
||||
"instructions": null,
|
||||
"max_output_tokens": null,
|
||||
"model": "gpt-4o-2024-08-06",
|
||||
"output": [
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_67eafd5fba44819287b79107821a818b0bfadc995fda2b45",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "Yes",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"parallel_tool_calls": true,
|
||||
"previous_response_id": null,
|
||||
"reasoning": {
|
||||
"effort": null,
|
||||
"generate_summary": null
|
||||
},
|
||||
"store": true,
|
||||
"temperature": 1.0,
|
||||
"text": {
|
||||
"format": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"tool_choice": "auto",
|
||||
"tools": [],
|
||||
"top_p": 1.0,
|
||||
"truncation": "disabled",
|
||||
"usage": {
|
||||
"input_tokens": 25,
|
||||
"input_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
},
|
||||
"output_tokens": 2,
|
||||
"output_tokens_details": {
|
||||
"reasoning_tokens": 0
|
||||
},
|
||||
"total_tokens": 27
|
||||
},
|
||||
"user": null,
|
||||
"metadata": {}
|
||||
}
|
||||
recorded_at: Mon, 31 Mar 2025 20:38:55 GMT
|
||||
recorded_with: VCR 6.3.1
|
||||
...
|
||||
|
|
92
test/vcr_cassettes/openai/chat/basic_streaming_response.yml
Normal file
92
test/vcr_cassettes/openai/chat/basic_streaming_response.yml
Normal file
|
@ -0,0 +1,92 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: https://api.openai.com/v1/responses
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"model":"gpt-4o","input":[{"role":"user","content":"This is a chat
|
||||
test. If it''s working, respond with a single word: Yes"}],"instructions":null,"tools":[],"previous_response_id":null,"stream":true}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
Authorization:
|
||||
- Bearer <OPENAI_ACCESS_TOKEN>
|
||||
Accept-Encoding:
|
||||
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
||||
Accept:
|
||||
- "*/*"
|
||||
User-Agent:
|
||||
- Ruby
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Date:
|
||||
- Mon, 31 Mar 2025 20:38:55 GMT
|
||||
Content-Type:
|
||||
- text/event-stream; charset=utf-8
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Connection:
|
||||
- keep-alive
|
||||
Openai-Version:
|
||||
- '2020-10-01'
|
||||
Openai-Organization:
|
||||
- "<OPENAI_ORGANIZATION_ID>"
|
||||
X-Request-Id:
|
||||
- req_d88b2a28252a098fe9f6e1223baebad8
|
||||
Openai-Processing-Ms:
|
||||
- '124'
|
||||
Strict-Transport-Security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
Cf-Cache-Status:
|
||||
- DYNAMIC
|
||||
Set-Cookie:
|
||||
- __cf_bm=wP2ENU9eOGUSzQ8wOjb31UiZAZVX021QgA1NuYcfKeo-1743453535-1.0.1.1-d08X7zX7cf._5LTGrF6qL17AtdgsKpEWLWnZ0dl5KgPWXEK.oqoDgoQ_pa8j5rKYZkeZUDxMhcpP266z9tJpPJ2ZPX8bkZYAjlnlcOa5.JM;
|
||||
path=/; expires=Mon, 31-Mar-25 21:08:55 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=F6OIQe1fgGYxb6xer0VjBA1aHrf6osX7wJU6adYsMy0-1743453535321-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
Server:
|
||||
- cloudflare
|
||||
Cf-Ray:
|
||||
- 9292a7324c3dcf78-CMH
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=86400
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: |+
|
||||
event: response.created
|
||||
data: {"type":"response.created","response":{"id":"resp_67eafd5f2b90819288af54361ff81a100e51d01dbd4ed330","object":"response","created_at":1743453535,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.in_progress
|
||||
data: {"type":"response.in_progress","response":{"id":"resp_67eafd5f2b90819288af54361ff81a100e51d01dbd4ed330","object":"response","created_at":1743453535,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.output_item.added
|
||||
data: {"type":"response.output_item.added","output_index":0,"item":{"type":"message","id":"msg_67eafd5f7c048192a24ce545ebfd908a0e51d01dbd4ed330","status":"in_progress","role":"assistant","content":[]}}
|
||||
|
||||
event: response.content_part.added
|
||||
data: {"type":"response.content_part.added","item_id":"msg_67eafd5f7c048192a24ce545ebfd908a0e51d01dbd4ed330","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd5f7c048192a24ce545ebfd908a0e51d01dbd4ed330","output_index":0,"content_index":0,"delta":"Yes"}
|
||||
|
||||
event: response.output_text.done
|
||||
data: {"type":"response.output_text.done","item_id":"msg_67eafd5f7c048192a24ce545ebfd908a0e51d01dbd4ed330","output_index":0,"content_index":0,"text":"Yes"}
|
||||
|
||||
event: response.content_part.done
|
||||
data: {"type":"response.content_part.done","item_id":"msg_67eafd5f7c048192a24ce545ebfd908a0e51d01dbd4ed330","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Yes","annotations":[]}}
|
||||
|
||||
event: response.output_item.done
|
||||
data: {"type":"response.output_item.done","output_index":0,"item":{"type":"message","id":"msg_67eafd5f7c048192a24ce545ebfd908a0e51d01dbd4ed330","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Yes","annotations":[]}]}}
|
||||
|
||||
event: response.completed
|
||||
data: {"type":"response.completed","response":{"id":"resp_67eafd5f2b90819288af54361ff81a100e51d01dbd4ed330","object":"response","created_at":1743453535,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[{"type":"message","id":"msg_67eafd5f7c048192a24ce545ebfd908a0e51d01dbd4ed330","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Yes","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":25,"input_tokens_details":{"cached_tokens":0},"output_tokens":2,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":27},"user":null,"metadata":{}}}
|
||||
|
||||
recorded_at: Mon, 31 Mar 2025 20:38:55 GMT
|
||||
recorded_with: VCR 6.3.1
|
||||
...
|
|
@ -5,8 +5,7 @@ http_interactions:
|
|||
uri: https://api.openai.com/v1/responses
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"model":"invalid-model-that-will-trigger-api-error","input":[{"role":"user","content":"Error
|
||||
test"}],"instructions":null,"tools":[],"previous_response_id":null,"stream":true}'
|
||||
string: '{"model":"invalid-model-that-will-trigger-api-error","input":[{"role":"user","content":"Test"}],"instructions":null,"tools":[],"previous_response_id":null,"stream":null}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
|
@ -24,7 +23,7 @@ http_interactions:
|
|||
message: Bad Request
|
||||
headers:
|
||||
Date:
|
||||
- Wed, 26 Mar 2025 21:27:19 GMT
|
||||
- Mon, 31 Mar 2025 20:38:55 GMT
|
||||
Content-Type:
|
||||
- application/json
|
||||
Content-Length:
|
||||
|
@ -36,25 +35,25 @@ http_interactions:
|
|||
Openai-Organization:
|
||||
- "<OPENAI_ORGANIZATION_ID>"
|
||||
X-Request-Id:
|
||||
- req_2b86e02f664e790dfa475f111402b722
|
||||
- req_3981f27aa18db734b3dd530fa2929b95
|
||||
Openai-Processing-Ms:
|
||||
- '146'
|
||||
- '113'
|
||||
Strict-Transport-Security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
Cf-Cache-Status:
|
||||
- DYNAMIC
|
||||
Set-Cookie:
|
||||
- __cf_bm=gAU0gS_ZQBfQmFkc_jKM73dhkNISbBY9FlQjGnZ6CfU-1743024439-1.0.1.1-bWRoC737.SOJPZrP90wTJLVmelTpxFqIsrunq2Lqgy4J3VvLtYBEBrqY0v4d94F5fMcm0Ju.TfQi0etmvqZtUSMRn6rvkMLmXexRcxP.1jE;
|
||||
path=/; expires=Wed, 26-Mar-25 21:57:19 GMT; domain=.api.openai.com; HttpOnly;
|
||||
- __cf_bm=8KUMK_Gp4f97KLactyy3QniUZbNmN9Zwbx9WowYCc98-1743453535-1.0.1.1-opjT17tCwi9U0AukBXoHrpPEcC4Z.GIyEt.AjjrzRWln62SWPIvggY4L19JabZu09.9cmxfyrwAFHmvDeCVxSWqAVf88PAZwwRICkZZUut0;
|
||||
path=/; expires=Mon, 31-Mar-25 21:08:55 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=XnxX4KU80himuKAUavZYtkQasOjXJDJD.QLyMrfBSUU-1743024439792-0.0.1.1-604800000;
|
||||
- _cfuvid=uZB07768IynyRRP6oxwcnC4Rfn.lGT1yRhzzGvNw0kc-1743453535322-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
Server:
|
||||
- cloudflare
|
||||
Cf-Ray:
|
||||
- 9269bb3b2c14cf74-CMH
|
||||
- 9292a7327d5161d6-ORD
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=86400
|
||||
body:
|
||||
|
@ -68,5 +67,5 @@ http_interactions:
|
|||
"code": "model_not_found"
|
||||
}
|
||||
}
|
||||
recorded_at: Wed, 26 Mar 2025 21:27:19 GMT
|
||||
recorded_at: Mon, 31 Mar 2025 20:38:55 GMT
|
||||
recorded_with: VCR 6.3.1
|
||||
|
|
247
test/vcr_cassettes/openai/chat/function_calls.yml
Normal file
247
test/vcr_cassettes/openai/chat/function_calls.yml
Normal file
|
@ -0,0 +1,247 @@
|
|||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: https://api.openai.com/v1/responses
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"model":"gpt-4o","input":[{"role":"user","content":"What is my net
|
||||
worth?"}],"instructions":"Use the tools available to you to answer the user''s
|
||||
question.","tools":[{"type":"function","name":"get_net_worth","description":"Gets
|
||||
a user''s net worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"previous_response_id":null,"stream":null}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
Authorization:
|
||||
- Bearer <OPENAI_ACCESS_TOKEN>
|
||||
Accept-Encoding:
|
||||
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
||||
Accept:
|
||||
- "*/*"
|
||||
User-Agent:
|
||||
- Ruby
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Date:
|
||||
- Mon, 31 Mar 2025 20:38:55 GMT
|
||||
Content-Type:
|
||||
- application/json
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Connection:
|
||||
- keep-alive
|
||||
Openai-Version:
|
||||
- '2020-10-01'
|
||||
Openai-Organization:
|
||||
- "<OPENAI_ORGANIZATION_ID>"
|
||||
X-Request-Id:
|
||||
- req_a179c8964589756af0d4b5af864a29a7
|
||||
Openai-Processing-Ms:
|
||||
- '761'
|
||||
Strict-Transport-Security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
Cf-Cache-Status:
|
||||
- DYNAMIC
|
||||
Set-Cookie:
|
||||
- __cf_bm=niiWOEhogNgWfxuZanJKipOlIrWGEPtp7bUpqDAp9Lo-1743453535-1.0.1.1-ytL9wC5t5fjY2v90vscRJLokIeZyVY2hmBqFuWbA_BOvZaw9aPFmtQDKhDD3WcLQryEtXiEGAyOANHnaeItCR0J_sXu7Jy4wdpJ4EMShQxU;
|
||||
path=/; expires=Mon, 31-Mar-25 21:08:55 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=kKjDNYSJJidsRTyFQWUgt6xlnqW_DkveNOUYxpBe9EE-1743453535972-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
Server:
|
||||
- cloudflare
|
||||
Cf-Ray:
|
||||
- 9292a732598dcf52-CMH
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=86400
|
||||
body:
|
||||
encoding: ASCII-8BIT
|
||||
string: |-
|
||||
{
|
||||
"id": "resp_67eafd5f2d1881928f10551839e8219102a5ebf5f2a599ef",
|
||||
"object": "response",
|
||||
"created_at": 1743453535,
|
||||
"status": "completed",
|
||||
"error": null,
|
||||
"incomplete_details": null,
|
||||
"instructions": "Use the tools available to you to answer the user's question.",
|
||||
"max_output_tokens": null,
|
||||
"model": "gpt-4o-2024-08-06",
|
||||
"output": [
|
||||
{
|
||||
"type": "function_call",
|
||||
"id": "fc_67eafd5f9c88819286afe92f08354f7302a5ebf5f2a599ef",
|
||||
"call_id": "call_KrFORr53UBxdwZ9SQ6fkpU0F",
|
||||
"name": "get_net_worth",
|
||||
"arguments": "{}",
|
||||
"status": "completed"
|
||||
}
|
||||
],
|
||||
"parallel_tool_calls": true,
|
||||
"previous_response_id": null,
|
||||
"reasoning": {
|
||||
"effort": null,
|
||||
"generate_summary": null
|
||||
},
|
||||
"store": true,
|
||||
"temperature": 1.0,
|
||||
"text": {
|
||||
"format": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"tool_choice": "auto",
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"description": "Gets a user's net worth",
|
||||
"name": "get_net_worth",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": [],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"strict": true
|
||||
}
|
||||
],
|
||||
"top_p": 1.0,
|
||||
"truncation": "disabled",
|
||||
"usage": {
|
||||
"input_tokens": 55,
|
||||
"input_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
},
|
||||
"output_tokens": 13,
|
||||
"output_tokens_details": {
|
||||
"reasoning_tokens": 0
|
||||
},
|
||||
"total_tokens": 68
|
||||
},
|
||||
"user": null,
|
||||
"metadata": {}
|
||||
}
|
||||
recorded_at: Mon, 31 Mar 2025 20:38:55 GMT
|
||||
- request:
|
||||
method: post
|
||||
uri: https://api.openai.com/v1/responses
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"model":"gpt-4o","input":[{"role":"user","content":"What is my net
|
||||
worth?"},{"type":"function_call_output","call_id":"call_KrFORr53UBxdwZ9SQ6fkpU0F","output":"\"{\\\"amount\\\":10000,\\\"currency\\\":\\\"USD\\\"}\""}],"instructions":null,"tools":[],"previous_response_id":"resp_67eafd5f2d1881928f10551839e8219102a5ebf5f2a599ef","stream":null}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
Authorization:
|
||||
- Bearer <OPENAI_ACCESS_TOKEN>
|
||||
Accept-Encoding:
|
||||
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
||||
Accept:
|
||||
- "*/*"
|
||||
User-Agent:
|
||||
- Ruby
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
headers:
|
||||
Date:
|
||||
- Mon, 31 Mar 2025 20:38:56 GMT
|
||||
Content-Type:
|
||||
- application/json
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Connection:
|
||||
- keep-alive
|
||||
Openai-Version:
|
||||
- '2020-10-01'
|
||||
Openai-Organization:
|
||||
- "<OPENAI_ORGANIZATION_ID>"
|
||||
X-Request-Id:
|
||||
- req_edd5bafc982bae46e92d0cd79e594779
|
||||
Openai-Processing-Ms:
|
||||
- '805'
|
||||
Strict-Transport-Security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
Cf-Cache-Status:
|
||||
- DYNAMIC
|
||||
Set-Cookie:
|
||||
- __cf_bm=jOZGEPyAByXhGrQIvKzbj_6TEODdZWw_S0BZsxbsuDc-1743453536-1.0.1.1-YpxHv.vmXVdwzQV5dMTB0I851tQSlDf.NboFddRq_aLDM1CnQW143gRcYbfPpCREij9SDqhnluZ4kxCuD3eaarhmFn2liMVHHRYUgMsUhck;
|
||||
path=/; expires=Mon, 31-Mar-25 21:08:56 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=1BoPw7WORdkfBQmal3sGAXdHGiJiFkXK8HXhWPWf7Vw-1743453536967-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
Server:
|
||||
- cloudflare
|
||||
Cf-Ray:
|
||||
- 9292a7385ec6cf62-CMH
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=86400
|
||||
body:
|
||||
encoding: ASCII-8BIT
|
||||
string: |-
|
||||
{
|
||||
"id": "resp_67eafd6023488192b382acd64a514ff002a5ebf5f2a599ef",
|
||||
"object": "response",
|
||||
"created_at": 1743453536,
|
||||
"status": "completed",
|
||||
"error": null,
|
||||
"incomplete_details": null,
|
||||
"instructions": null,
|
||||
"max_output_tokens": null,
|
||||
"model": "gpt-4o-2024-08-06",
|
||||
"output": [
|
||||
{
|
||||
"type": "message",
|
||||
"id": "msg_67eafd60a42c8192906eb4d48f8970de02a5ebf5f2a599ef",
|
||||
"status": "completed",
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{
|
||||
"type": "output_text",
|
||||
"text": "Your net worth is $10,000 USD.",
|
||||
"annotations": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"parallel_tool_calls": true,
|
||||
"previous_response_id": "resp_67eafd5f2d1881928f10551839e8219102a5ebf5f2a599ef",
|
||||
"reasoning": {
|
||||
"effort": null,
|
||||
"generate_summary": null
|
||||
},
|
||||
"store": true,
|
||||
"temperature": 1.0,
|
||||
"text": {
|
||||
"format": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"tool_choice": "auto",
|
||||
"tools": [],
|
||||
"top_p": 1.0,
|
||||
"truncation": "disabled",
|
||||
"usage": {
|
||||
"input_tokens": 58,
|
||||
"input_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
},
|
||||
"output_tokens": 11,
|
||||
"output_tokens_details": {
|
||||
"reasoning_tokens": 0
|
||||
},
|
||||
"total_tokens": 69
|
||||
},
|
||||
"user": null,
|
||||
"metadata": {}
|
||||
}
|
||||
recorded_at: Mon, 31 Mar 2025 20:38:57 GMT
|
||||
recorded_with: VCR 6.3.1
|
|
@ -8,7 +8,7 @@ http_interactions:
|
|||
string: '{"model":"gpt-4o","input":[{"role":"user","content":"What is my net
|
||||
worth?"}],"instructions":"Use the tools available to you to answer the user''s
|
||||
question.","tools":[{"type":"function","name":"get_net_worth","description":"Gets
|
||||
user net worth data","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"previous_response_id":null,"stream":true}'
|
||||
a user''s net worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"previous_response_id":null,"stream":true}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
|
@ -26,7 +26,7 @@ http_interactions:
|
|||
message: OK
|
||||
headers:
|
||||
Date:
|
||||
- Wed, 26 Mar 2025 21:22:09 GMT
|
||||
- Mon, 31 Mar 2025 20:38:55 GMT
|
||||
Content-Type:
|
||||
- text/event-stream; charset=utf-8
|
||||
Transfer-Encoding:
|
||||
|
@ -38,60 +38,59 @@ http_interactions:
|
|||
Openai-Organization:
|
||||
- "<OPENAI_ORGANIZATION_ID>"
|
||||
X-Request-Id:
|
||||
- req_4f04cffbab6051b3ac301038e3796092
|
||||
- req_8c4d6f0ad0ae3095353a5c19fd128c56
|
||||
Openai-Processing-Ms:
|
||||
- '114'
|
||||
- '129'
|
||||
Strict-Transport-Security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
Cf-Cache-Status:
|
||||
- DYNAMIC
|
||||
Set-Cookie:
|
||||
- __cf_bm=F5haUlL1HA1srjwZugBxG6XWbGg.NyQBnJTTirKs5KI-1743024129-1.0.1.1-D842I3sPgDgH_KXyroq6uVivEnbWvm9WJF.L8a11GgUcULXjhweLHs0mXe6MWruf.FJe.lZj.KmX0tCqqdpKIt5JvlbHXt5D_9svedktlZY;
|
||||
path=/; expires=Wed, 26-Mar-25 21:52:09 GMT; domain=.api.openai.com; HttpOnly;
|
||||
- __cf_bm=5yRGSo0Y69GvEK51Bq2.Np0DSg9DmAJKNqvE3_XgKBg-1743453535-1.0.1.1-sH1YR42zmznwvKlaBUM.bPKvJl_PiebfNBKhREMO.sSa5gvFEkpcKaCG4x3XUdZ19XGTEF0CbRII3mqtcPJhxFzX3uVLGuVsyjz6odYDisM;
|
||||
path=/; expires=Mon, 31-Mar-25 21:08:55 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=MmuRzsy8ebDMe6ibCEwtGp2RzcntpAmdvDlhIZtlY1s-1743024129721-0.0.1.1-604800000;
|
||||
- _cfuvid=tblnBnP9s7yFkSzbYy9zuzuDkxS9i_n7hk3XdiiGui8-1743453535332-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
Server:
|
||||
- cloudflare
|
||||
Cf-Ray:
|
||||
- 9269b3a97f370002-ORD
|
||||
- 9292a7324dfbcf46-CMH
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=86400
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: |+
|
||||
event: response.created
|
||||
data: {"type":"response.created","response":{"id":"resp_67e4700196288192b27a4effc08dc47f069d9116026394b6","object":"response","created_at":1743024129,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"Gets user net worth data","name":"get_net_worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
data: {"type":"response.created","response":{"id":"resp_67eafd5f2ef0819290ec6bbbc5f27c8e0aa8698ee903b906","object":"response","created_at":1743453535,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"Gets a user's net worth","name":"get_net_worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.in_progress
|
||||
data: {"type":"response.in_progress","response":{"id":"resp_67e4700196288192b27a4effc08dc47f069d9116026394b6","object":"response","created_at":1743024129,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"Gets user net worth data","name":"get_net_worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
data: {"type":"response.in_progress","response":{"id":"resp_67eafd5f2ef0819290ec6bbbc5f27c8e0aa8698ee903b906","object":"response","created_at":1743453535,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"Gets a user's net worth","name":"get_net_worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.output_item.added
|
||||
data: {"type":"response.output_item.added","output_index":0,"item":{"type":"function_call","id":"fc_67e4700222008192b3a26ce30fe7ad02069d9116026394b6","call_id":"call_FtvrJsTMg7he0mTeThIqktyL","name":"get_net_worth","arguments":"","status":"in_progress"}}
|
||||
data: {"type":"response.output_item.added","output_index":0,"item":{"type":"function_call","id":"fc_67eafd5fa714819287b2bff8c76935690aa8698ee903b906","call_id":"call_7EY6rF7mkfNyMIz3HQmrYIOq","name":"get_net_worth","arguments":"","status":"in_progress"}}
|
||||
|
||||
event: response.function_call_arguments.delta
|
||||
data: {"type":"response.function_call_arguments.delta","item_id":"fc_67e4700222008192b3a26ce30fe7ad02069d9116026394b6","output_index":0,"delta":"{}"}
|
||||
data: {"type":"response.function_call_arguments.delta","item_id":"fc_67eafd5fa714819287b2bff8c76935690aa8698ee903b906","output_index":0,"delta":"{}"}
|
||||
|
||||
event: response.function_call_arguments.done
|
||||
data: {"type":"response.function_call_arguments.done","item_id":"fc_67e4700222008192b3a26ce30fe7ad02069d9116026394b6","output_index":0,"arguments":"{}"}
|
||||
data: {"type":"response.function_call_arguments.done","item_id":"fc_67eafd5fa714819287b2bff8c76935690aa8698ee903b906","output_index":0,"arguments":"{}"}
|
||||
|
||||
event: response.output_item.done
|
||||
data: {"type":"response.output_item.done","output_index":0,"item":{"type":"function_call","id":"fc_67e4700222008192b3a26ce30fe7ad02069d9116026394b6","call_id":"call_FtvrJsTMg7he0mTeThIqktyL","name":"get_net_worth","arguments":"{}","status":"completed"}}
|
||||
data: {"type":"response.output_item.done","output_index":0,"item":{"type":"function_call","id":"fc_67eafd5fa714819287b2bff8c76935690aa8698ee903b906","call_id":"call_7EY6rF7mkfNyMIz3HQmrYIOq","name":"get_net_worth","arguments":"{}","status":"completed"}}
|
||||
|
||||
event: response.completed
|
||||
data: {"type":"response.completed","response":{"id":"resp_67e4700196288192b27a4effc08dc47f069d9116026394b6","object":"response","created_at":1743024129,"status":"completed","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[{"type":"function_call","id":"fc_67e4700222008192b3a26ce30fe7ad02069d9116026394b6","call_id":"call_FtvrJsTMg7he0mTeThIqktyL","name":"get_net_worth","arguments":"{}","status":"completed"}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"Gets user net worth data","name":"get_net_worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":271,"input_tokens_details":{"cached_tokens":0},"output_tokens":13,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":284},"user":null,"metadata":{}}}
|
||||
data: {"type":"response.completed","response":{"id":"resp_67eafd5f2ef0819290ec6bbbc5f27c8e0aa8698ee903b906","object":"response","created_at":1743453535,"status":"completed","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[{"type":"function_call","id":"fc_67eafd5fa714819287b2bff8c76935690aa8698ee903b906","call_id":"call_7EY6rF7mkfNyMIz3HQmrYIOq","name":"get_net_worth","arguments":"{}","status":"completed"}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"function","description":"Gets a user's net worth","name":"get_net_worth","parameters":{"type":"object","properties":{},"required":[],"additionalProperties":false},"strict":true}],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":55,"input_tokens_details":{"cached_tokens":0},"output_tokens":13,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":68},"user":null,"metadata":{}}}
|
||||
|
||||
recorded_at: Wed, 26 Mar 2025 21:22:10 GMT
|
||||
recorded_at: Mon, 31 Mar 2025 20:38:55 GMT
|
||||
- request:
|
||||
method: post
|
||||
uri: https://api.openai.com/v1/responses
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: '{"model":"gpt-4o","input":[{"role":"user","content":"What is my net
|
||||
worth?"},{"type":"function_call_output","call_id":"call_FtvrJsTMg7he0mTeThIqktyL","output":"\"$124,200\""}],"instructions":"Use
|
||||
the tools available to you to answer the user''s question.","tools":[],"previous_response_id":"resp_67e4700196288192b27a4effc08dc47f069d9116026394b6","stream":true}'
|
||||
worth?"},{"type":"function_call_output","call_id":"call_7EY6rF7mkfNyMIz3HQmrYIOq","output":"{\"amount\":10000,\"currency\":\"USD\"}"}],"instructions":null,"tools":[],"previous_response_id":"resp_67eafd5f2ef0819290ec6bbbc5f27c8e0aa8698ee903b906","stream":true}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
|
@ -109,7 +108,7 @@ http_interactions:
|
|||
message: OK
|
||||
headers:
|
||||
Date:
|
||||
- Wed, 26 Mar 2025 21:22:10 GMT
|
||||
- Mon, 31 Mar 2025 20:38:56 GMT
|
||||
Content-Type:
|
||||
- text/event-stream; charset=utf-8
|
||||
Transfer-Encoding:
|
||||
|
@ -121,81 +120,84 @@ http_interactions:
|
|||
Openai-Organization:
|
||||
- "<OPENAI_ORGANIZATION_ID>"
|
||||
X-Request-Id:
|
||||
- req_792bf572fac53f7e139b29d462933d8f
|
||||
- req_be9f30124a3a4cdae2d3b038692f6699
|
||||
Openai-Processing-Ms:
|
||||
- '148'
|
||||
- '177'
|
||||
Strict-Transport-Security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
Cf-Cache-Status:
|
||||
- DYNAMIC
|
||||
Set-Cookie:
|
||||
- __cf_bm=HHguTnSUQFt9KezJAQCrQF_OHn8ZH1C4xDjXRgexdzM-1743024130-1.0.1.1-ZhqxuASVfISfGQbvvKSNy_OQiUfkeIPN2DZhors0K4cl_BzE_P5u9kbc1HkgwyW1A_6GNAenh8Fr9AkoJ0zSakdg5Dr9AU.lu5nr7adQ_60;
|
||||
path=/; expires=Wed, 26-Mar-25 21:52:10 GMT; domain=.api.openai.com; HttpOnly;
|
||||
- __cf_bm=gNS8vmdzyz2jct__mfjLZGkJhCxddarRy62IkzSIFWM-1743453536-1.0.1.1-ufcPPmSzEaEysjhkRUozTfCIriRWy5iyeXCaVqeFDaJDWT4lc8ate4JhryV0fVQSZBi6pRN8zYh9dkLyYuXoSqYDCsZTN1uk6vO84nX1qGo;
|
||||
path=/; expires=Mon, 31-Mar-25 21:08:56 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=hX9Y33ruiC9mhYzrOoxyOh23Gy.MfQa54h9l5CllWlI-1743024130948-0.0.1.1-604800000;
|
||||
- _cfuvid=3D41ZgFle.u0ER2Ehnm.bsdnSGlCXVArPa7bx9zumYU-1743453536171-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
Server:
|
||||
- cloudflare
|
||||
Cf-Ray:
|
||||
- 9269b3b0da83cf67-CMH
|
||||
- 9292a7376f5acf4e-CMH
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=86400
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: |+
|
||||
event: response.created
|
||||
data: {"type":"response.created","response":{"id":"resp_67e47002c5b48192a8202d45c6a929f8069d9116026394b6","object":"response","created_at":1743024130,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":"resp_67e4700196288192b27a4effc08dc47f069d9116026394b6","reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
data: {"type":"response.created","response":{"id":"resp_67eafd5ff7448192af7cd9e9dde90f5e0aa8698ee903b906","object":"response","created_at":1743453536,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":"resp_67eafd5f2ef0819290ec6bbbc5f27c8e0aa8698ee903b906","reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.in_progress
|
||||
data: {"type":"response.in_progress","response":{"id":"resp_67e47002c5b48192a8202d45c6a929f8069d9116026394b6","object":"response","created_at":1743024130,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":"resp_67e4700196288192b27a4effc08dc47f069d9116026394b6","reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
data: {"type":"response.in_progress","response":{"id":"resp_67eafd5ff7448192af7cd9e9dde90f5e0aa8698ee903b906","object":"response","created_at":1743453536,"status":"in_progress","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":"resp_67eafd5f2ef0819290ec6bbbc5f27c8e0aa8698ee903b906","reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}}
|
||||
|
||||
event: response.output_item.added
|
||||
data: {"type":"response.output_item.added","output_index":0,"item":{"type":"message","id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","status":"in_progress","role":"assistant","content":[]}}
|
||||
data: {"type":"response.output_item.added","output_index":0,"item":{"type":"message","id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","status":"in_progress","role":"assistant","content":[]}}
|
||||
|
||||
event: response.content_part.added
|
||||
data: {"type":"response.content_part.added","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
|
||||
data: {"type":"response.content_part.added","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":"Your"}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":"Your"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":" net"}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":" net"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":" worth"}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":" worth"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":" is"}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":" is"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":" $"}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":" $"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":"124"}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":"10"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":","}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":","}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":"200"}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":"000"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"delta":"."}
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":" USD"}
|
||||
|
||||
event: response.output_text.delta
|
||||
data: {"type":"response.output_text.delta","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"delta":"."}
|
||||
|
||||
event: response.output_text.done
|
||||
data: {"type":"response.output_text.done","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"text":"Your net worth is $124,200."}
|
||||
data: {"type":"response.output_text.done","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"text":"Your net worth is $10,000 USD."}
|
||||
|
||||
event: response.content_part.done
|
||||
data: {"type":"response.content_part.done","item_id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Your net worth is $124,200.","annotations":[]}}
|
||||
data: {"type":"response.content_part.done","item_id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Your net worth is $10,000 USD.","annotations":[]}}
|
||||
|
||||
event: response.output_item.done
|
||||
data: {"type":"response.output_item.done","output_index":0,"item":{"type":"message","id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Your net worth is $124,200.","annotations":[]}]}}
|
||||
data: {"type":"response.output_item.done","output_index":0,"item":{"type":"message","id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Your net worth is $10,000 USD.","annotations":[]}]}}
|
||||
|
||||
event: response.completed
|
||||
data: {"type":"response.completed","response":{"id":"resp_67e47002c5b48192a8202d45c6a929f8069d9116026394b6","object":"response","created_at":1743024130,"status":"completed","error":null,"incomplete_details":null,"instructions":"Use the tools available to you to answer the user's question.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[{"type":"message","id":"msg_67e47003483c819290ae392b826c4910069d9116026394b6","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Your net worth is $124,200.","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":"resp_67e4700196288192b27a4effc08dc47f069d9116026394b6","reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":85,"input_tokens_details":{"cached_tokens":0},"output_tokens":10,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":95},"user":null,"metadata":{}}}
|
||||
data: {"type":"response.completed","response":{"id":"resp_67eafd5ff7448192af7cd9e9dde90f5e0aa8698ee903b906","object":"response","created_at":1743453536,"status":"completed","error":null,"incomplete_details":null,"instructions":null,"max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[{"type":"message","id":"msg_67eafd6084ec81929a5132414ef713180aa8698ee903b906","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Your net worth is $10,000 USD.","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":"resp_67eafd5f2ef0819290ec6bbbc5f27c8e0aa8698ee903b906","reasoning":{"effort":null,"generate_summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":56,"input_tokens_details":{"cached_tokens":0},"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":67},"user":null,"metadata":{}}}
|
||||
|
||||
recorded_at: Wed, 26 Mar 2025 21:22:11 GMT
|
||||
recorded_at: Mon, 31 Mar 2025 20:38:58 GMT
|
||||
recorded_with: VCR 6.3.1
|
||||
...
|
Loading…
Add table
Add a link
Reference in a new issue