mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 08:38:30 +00:00
Adding VCr and cassetes
This commit is contained in:
@@ -12,8 +12,7 @@ researcher = Agent(
|
||||
)
|
||||
tools = AgentTools(agents=[researcher])
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
def test_delegate_work():
|
||||
result = tools.delegate_work(
|
||||
command="researcher|share your take on AI Agents|I heard you hate them"
|
||||
@@ -21,7 +20,7 @@ def test_delegate_work():
|
||||
|
||||
assert result == "I apologize if my previous statements have given you the impression that I hate AI agents. As a technology researcher, I don't hold personal sentiments towards AI or any other technology. Rather, I analyze them objectively based on their capabilities, applications, and implications. AI agents, in particular, are a fascinating domain of research. They hold tremendous potential in automating and optimizing various tasks across industries. However, like any other technology, they come with their own set of challenges, such as ethical considerations around privacy and decision-making. My objective is to understand these technologies in depth and provide a balanced view."
|
||||
|
||||
@pytest.mark.vcr()
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
def test_ask_question():
|
||||
result = tools.ask_question(
|
||||
command="researcher|do you hate AI Agents?|I heard you LOVE them"
|
||||
@@ -29,12 +28,16 @@ def test_ask_question():
|
||||
|
||||
assert result == "As an AI, I don't possess feelings or emotions, so I don't love or hate anything. However, I can provide detailed analysis and research on AI agents. They are a fascinating field of study with the potential to revolutionize many industries, although they also present certain challenges and ethical considerations."
|
||||
|
||||
def test_can_not_self_delegate():
|
||||
# TODO: Add test for self delegation
|
||||
pass
|
||||
|
||||
def test_delegate_work_with_wrong_input():
|
||||
result = tools.ask_question(
|
||||
command="writer|share your take on AI Agents"
|
||||
)
|
||||
|
||||
assert result == "Error executing tool. Missing exact 3 pipe (|) separated values."
|
||||
assert result == "Error executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|task|information`."
|
||||
|
||||
def test_delegate_work_to_wrong_agent():
|
||||
result = tools.ask_question(
|
||||
|
||||
251
tests/agent_tools/cassettes/test_ask_question.yaml
Normal file
251
tests/agent_tools/cassettes/test_ask_question.yaml
Normal file
@@ -0,0 +1,251 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages": [{"role": "user", "content": "You are researcher.\nYou''re
|
||||
an expert researcher, specialized in technology\n\nYour personal goal is: make
|
||||
the best research and analysis on content about AI and AI agents\n\nTOOLS:\n------\nYou
|
||||
have access to the following tools:\n\n\n\nTo use a tool, please use the exact
|
||||
following format:\n\n```\nThought: Do I need to use a tool? Yes\nAction: the
|
||||
action to take, should be one of []\nAction Input: the input to the action\nObservation:
|
||||
the result of the action\n```\n\nWhen you have a response for your task, or
|
||||
if you do not need to use a tool, you MUST use the format:\n\n```\nThought:
|
||||
Do I need to use a tool? No\nFinal Answer: [your response here]\n```\n\t\tThis
|
||||
is the summary of your work so far:\n The human asks the AI for its opinion
|
||||
on AI agents, based on the impression that the AI dislikes them. The AI clarifies
|
||||
that it doesn''t hold personal sentiments towards AI or any technology, but
|
||||
instead analyzes them objectively. The AI finds AI agents a fascinating domain
|
||||
of research with great potential for task automation and optimization across
|
||||
industries, but acknowledges they present challenges such as ethical considerations
|
||||
around privacy and decision-making.\nBegin! This is VERY important to you, your
|
||||
job depends on it!\n\nCurrent Task: do you hate AI Agents?\n\nThis is the context
|
||||
you are working with:\nI heard you LOVE them\n\n"}], "model": "gpt-4", "n":
|
||||
1, "stop": ["\nObservation"], "stream": false, "temperature": 0.7}'
|
||||
headers:
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- gzip, deflate
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1494'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- __cf_bm=k2HUdEp80irAkv.3wl0c6unbzRUujrE1TnJeObxyuHw-1703102483-1-AZe8OKi9NWunQ9x4f3lkdOpb/hJIp/3oyXUqPhkcmcEHXvFTkMcv77NSclcoz9DjRhwC62ZvANkWImyVRM4seH4=;
|
||||
_cfuvid=8qN4npFFWXAqn.wugd0jrQ36YkreDcTGH14We.FcBjg-1703102483136-0-604800000
|
||||
host:
|
||||
- api.openai.com
|
||||
user-agent:
|
||||
- OpenAI/Python 1.6.0
|
||||
x-stainless-arch:
|
||||
- arm64
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- MacOS
|
||||
x-stainless-package-version:
|
||||
- 1.6.0
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.11.7
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
content: "{\n \"id\": \"chatcmpl-8Xx2vMXN4WCrWeeO4DOAowhb3oeDJ\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1703102489,\n \"model\": \"gpt-4-0613\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Thought: Do I need to use a tool? No\\nFinal
|
||||
Answer: As an AI, I don't possess feelings or emotions, so I don't love or hate
|
||||
anything. However, I can provide detailed analysis and research on AI agents.
|
||||
They are a fascinating field of study with the potential to revolutionize many
|
||||
industries, although they also present certain challenges and ethical considerations.\"\n
|
||||
\ },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n
|
||||
\ ],\n \"usage\": {\n \"prompt_tokens\": 291,\n \"completion_tokens\":
|
||||
75,\n \"total_tokens\": 366\n },\n \"system_fingerprint\": null\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-RAY:
|
||||
- 838a7a3efab6a4b0-GRU
|
||||
Cache-Control:
|
||||
- no-cache, must-revalidate
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Encoding:
|
||||
- gzip
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Wed, 20 Dec 2023 20:01:35 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
access-control-allow-origin:
|
||||
- '*'
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
openai-model:
|
||||
- gpt-4-0613
|
||||
openai-organization:
|
||||
- user-z7g4wmlazxqvc5wjyaaaocfz
|
||||
openai-processing-ms:
|
||||
- '6060'
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
strict-transport-security:
|
||||
- max-age=15724800; includeSubDomains
|
||||
x-ratelimit-limit-requests:
|
||||
- '10000'
|
||||
x-ratelimit-limit-tokens:
|
||||
- '300000'
|
||||
x-ratelimit-limit-tokens_usage_based:
|
||||
- '300000'
|
||||
x-ratelimit-remaining-requests:
|
||||
- '9999'
|
||||
x-ratelimit-remaining-tokens:
|
||||
- '299652'
|
||||
x-ratelimit-remaining-tokens_usage_based:
|
||||
- '299652'
|
||||
x-ratelimit-reset-requests:
|
||||
- 6ms
|
||||
x-ratelimit-reset-tokens:
|
||||
- 69ms
|
||||
x-ratelimit-reset-tokens_usage_based:
|
||||
- 69ms
|
||||
x-request-id:
|
||||
- 3ad0d047d5260434816f61ec105bdbb8
|
||||
http_version: HTTP/1.1
|
||||
status_code: 200
|
||||
- request:
|
||||
body: '{"messages": [{"role": "user", "content": "Progressively summarize the
|
||||
lines of conversation provided, adding onto the previous summary returning a
|
||||
new summary.\n\nEXAMPLE\nCurrent summary:\nThe human asks what the AI thinks
|
||||
of artificial intelligence. The AI thinks artificial intelligence is a force
|
||||
for good.\n\nNew lines of conversation:\nHuman: Why do you think artificial
|
||||
intelligence is a force for good?\nAI: Because artificial intelligence will
|
||||
help humans reach their full potential.\n\nNew summary:\nThe human asks what
|
||||
the AI thinks of artificial intelligence. The AI thinks artificial intelligence
|
||||
is a force for good because it will help humans reach their full potential.\nEND
|
||||
OF EXAMPLE\n\nCurrent summary:\nThe human asks the AI for its opinion on AI
|
||||
agents, based on the impression that the AI dislikes them. The AI clarifies
|
||||
that it doesn''t hold personal sentiments towards AI or any technology, but
|
||||
instead analyzes them objectively. The AI finds AI agents a fascinating domain
|
||||
of research with great potential for task automation and optimization across
|
||||
industries, but acknowledges they present challenges such as ethical considerations
|
||||
around privacy and decision-making.\n\nNew lines of conversation:\nHuman: do
|
||||
you hate AI Agents?\n\nThis is the context you are working with:\nI heard you
|
||||
LOVE them\nAI: As an AI, I don''t possess feelings or emotions, so I don''t
|
||||
love or hate anything. However, I can provide detailed analysis and research
|
||||
on AI agents. They are a fascinating field of study with the potential to revolutionize
|
||||
many industries, although they also present certain challenges and ethical considerations.\n\nNew
|
||||
summary:"}], "model": "gpt-4", "n": 1, "stream": false, "temperature": 0.7}'
|
||||
headers:
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- gzip, deflate
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1726'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- __cf_bm=k2HUdEp80irAkv.3wl0c6unbzRUujrE1TnJeObxyuHw-1703102483-1-AZe8OKi9NWunQ9x4f3lkdOpb/hJIp/3oyXUqPhkcmcEHXvFTkMcv77NSclcoz9DjRhwC62ZvANkWImyVRM4seH4=;
|
||||
_cfuvid=8qN4npFFWXAqn.wugd0jrQ36YkreDcTGH14We.FcBjg-1703102483136-0-604800000
|
||||
host:
|
||||
- api.openai.com
|
||||
user-agent:
|
||||
- OpenAI/Python 1.6.0
|
||||
x-stainless-arch:
|
||||
- arm64
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- MacOS
|
||||
x-stainless-package-version:
|
||||
- 1.6.0
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.11.7
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
content: "{\n \"id\": \"chatcmpl-8Xx32X5innWZd8vEETP1jZMLH3b1O\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1703102496,\n \"model\": \"gpt-4-0613\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"The human asks the AI for its opinion
|
||||
on AI agents, based on the impression that the AI dislikes them. The AI clarifies
|
||||
that it doesn't hold personal sentiments towards AI or any technology, but instead
|
||||
analyzes them objectively. The AI finds AI agents a fascinating domain of research
|
||||
with great potential for task automation and optimization across industries,
|
||||
but acknowledges they present challenges such as ethical considerations around
|
||||
privacy and decision-making. When asked again if it hates or loves AI agents,
|
||||
the AI reiterates that it doesn't possess feelings or emotions, but can provide
|
||||
detailed analysis and research on AI agents.\"\n },\n \"logprobs\":
|
||||
null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
300,\n \"completion_tokens\": 117,\n \"total_tokens\": 417\n },\n \"system_fingerprint\":
|
||||
null\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-RAY:
|
||||
- 838a7a67ecaca4b0-GRU
|
||||
Cache-Control:
|
||||
- no-cache, must-revalidate
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Encoding:
|
||||
- gzip
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Wed, 20 Dec 2023 20:01:41 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
access-control-allow-origin:
|
||||
- '*'
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
openai-model:
|
||||
- gpt-4-0613
|
||||
openai-organization:
|
||||
- user-z7g4wmlazxqvc5wjyaaaocfz
|
||||
openai-processing-ms:
|
||||
- '5610'
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
strict-transport-security:
|
||||
- max-age=15724800; includeSubDomains
|
||||
x-ratelimit-limit-requests:
|
||||
- '10000'
|
||||
x-ratelimit-limit-tokens:
|
||||
- '300000'
|
||||
x-ratelimit-limit-tokens_usage_based:
|
||||
- '300000'
|
||||
x-ratelimit-remaining-requests:
|
||||
- '9999'
|
||||
x-ratelimit-remaining-tokens:
|
||||
- '299585'
|
||||
x-ratelimit-remaining-tokens_usage_based:
|
||||
- '299585'
|
||||
x-ratelimit-reset-requests:
|
||||
- 6ms
|
||||
x-ratelimit-reset-tokens:
|
||||
- 83ms
|
||||
x-ratelimit-reset-tokens_usage_based:
|
||||
- 83ms
|
||||
x-request-id:
|
||||
- 5b0b96506faa544c5d35b52286a3389c
|
||||
http_version: HTTP/1.1
|
||||
status_code: 200
|
||||
version: 1
|
||||
250
tests/agent_tools/cassettes/test_delegate_work.yaml
Normal file
250
tests/agent_tools/cassettes/test_delegate_work.yaml
Normal file
@@ -0,0 +1,250 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages": [{"role": "user", "content": "You are researcher.\nYou''re
|
||||
an expert researcher, specialized in technology\n\nYour personal goal is: make
|
||||
the best research and analysis on content about AI and AI agents\n\nTOOLS:\n------\nYou
|
||||
have access to the following tools:\n\n\n\nTo use a tool, please use the exact
|
||||
following format:\n\n```\nThought: Do I need to use a tool? Yes\nAction: the
|
||||
action to take, should be one of []\nAction Input: the input to the action\nObservation:
|
||||
the result of the action\n```\n\nWhen you have a response for your task, or
|
||||
if you do not need to use a tool, you MUST use the format:\n\n```\nThought:
|
||||
Do I need to use a tool? No\nFinal Answer: [your response here]\n```\n\t\tThis
|
||||
is the summary of your work so far:\n \nBegin! This is VERY important to
|
||||
you, your job depends on it!\n\nCurrent Task: share your take on AI Agents\n\nThis
|
||||
is the context you are working with:\nI heard you hate them\n\n"}], "model":
|
||||
"gpt-4", "n": 1, "stop": ["\nObservation"], "stream": false, "temperature":
|
||||
0.7}'
|
||||
headers:
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- gzip, deflate
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1030'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
user-agent:
|
||||
- OpenAI/Python 1.6.0
|
||||
x-stainless-arch:
|
||||
- arm64
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- MacOS
|
||||
x-stainless-package-version:
|
||||
- 1.6.0
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.11.7
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
content: "{\n \"id\": \"chatcmpl-8Xx2cQWLZ8Nd34HGmbQluyZWlD58b\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1703102470,\n \"model\": \"gpt-4-0613\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Thought: Do I need to use a tool? No\\nFinal
|
||||
Answer: I apologize if my previous statements have given you the impression
|
||||
that I hate AI agents. As a technology researcher, I don't hold personal sentiments
|
||||
towards AI or any other technology. Rather, I analyze them objectively based
|
||||
on their capabilities, applications, and implications. AI agents, in particular,
|
||||
are a fascinating domain of research. They hold tremendous potential in automating
|
||||
and optimizing various tasks across industries. However, like any other technology,
|
||||
they come with their own set of challenges, such as ethical considerations around
|
||||
privacy and decision-making. My objective is to understand these technologies
|
||||
in depth and provide a balanced view.\"\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
211,\n \"completion_tokens\": 134,\n \"total_tokens\": 345\n },\n \"system_fingerprint\":
|
||||
null\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-RAY:
|
||||
- 838a79c59ea7a4b0-GRU
|
||||
Cache-Control:
|
||||
- no-cache, must-revalidate
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Encoding:
|
||||
- gzip
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Wed, 20 Dec 2023 20:01:23 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- __cf_bm=k2HUdEp80irAkv.3wl0c6unbzRUujrE1TnJeObxyuHw-1703102483-1-AZe8OKi9NWunQ9x4f3lkdOpb/hJIp/3oyXUqPhkcmcEHXvFTkMcv77NSclcoz9DjRhwC62ZvANkWImyVRM4seH4=;
|
||||
path=/; expires=Wed, 20-Dec-23 20:31:23 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=8qN4npFFWXAqn.wugd0jrQ36YkreDcTGH14We.FcBjg-1703102483136-0-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
access-control-allow-origin:
|
||||
- '*'
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
openai-model:
|
||||
- gpt-4-0613
|
||||
openai-organization:
|
||||
- user-z7g4wmlazxqvc5wjyaaaocfz
|
||||
openai-processing-ms:
|
||||
- '12923'
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
strict-transport-security:
|
||||
- max-age=15724800; includeSubDomains
|
||||
x-ratelimit-limit-requests:
|
||||
- '10000'
|
||||
x-ratelimit-limit-tokens:
|
||||
- '300000'
|
||||
x-ratelimit-limit-tokens_usage_based:
|
||||
- '300000'
|
||||
x-ratelimit-remaining-requests:
|
||||
- '9999'
|
||||
x-ratelimit-remaining-tokens:
|
||||
- '299769'
|
||||
x-ratelimit-remaining-tokens_usage_based:
|
||||
- '299769'
|
||||
x-ratelimit-reset-requests:
|
||||
- 6ms
|
||||
x-ratelimit-reset-tokens:
|
||||
- 46ms
|
||||
x-ratelimit-reset-tokens_usage_based:
|
||||
- 46ms
|
||||
x-request-id:
|
||||
- 6468cdd7ae76aea910c72a503a58b8da
|
||||
http_version: HTTP/1.1
|
||||
status_code: 200
|
||||
- request:
|
||||
body: '{"messages": [{"role": "user", "content": "Progressively summarize the
|
||||
lines of conversation provided, adding onto the previous summary returning a
|
||||
new summary.\n\nEXAMPLE\nCurrent summary:\nThe human asks what the AI thinks
|
||||
of artificial intelligence. The AI thinks artificial intelligence is a force
|
||||
for good.\n\nNew lines of conversation:\nHuman: Why do you think artificial
|
||||
intelligence is a force for good?\nAI: Because artificial intelligence will
|
||||
help humans reach their full potential.\n\nNew summary:\nThe human asks what
|
||||
the AI thinks of artificial intelligence. The AI thinks artificial intelligence
|
||||
is a force for good because it will help humans reach their full potential.\nEND
|
||||
OF EXAMPLE\n\nCurrent summary:\n\n\nNew lines of conversation:\nHuman: share
|
||||
your take on AI Agents\n\nThis is the context you are working with:\nI heard
|
||||
you hate them\nAI: I apologize if my previous statements have given you the
|
||||
impression that I hate AI agents. As a technology researcher, I don''t hold
|
||||
personal sentiments towards AI or any other technology. Rather, I analyze them
|
||||
objectively based on their capabilities, applications, and implications. AI
|
||||
agents, in particular, are a fascinating domain of research. They hold tremendous
|
||||
potential in automating and optimizing various tasks across industries. However,
|
||||
like any other technology, they come with their own set of challenges, such
|
||||
as ethical considerations around privacy and decision-making. My objective is
|
||||
to understand these technologies in depth and provide a balanced view.\n\nNew
|
||||
summary:"}], "model": "gpt-4", "n": 1, "stream": false, "temperature": 0.7}'
|
||||
headers:
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- gzip, deflate
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1622'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- __cf_bm=k2HUdEp80irAkv.3wl0c6unbzRUujrE1TnJeObxyuHw-1703102483-1-AZe8OKi9NWunQ9x4f3lkdOpb/hJIp/3oyXUqPhkcmcEHXvFTkMcv77NSclcoz9DjRhwC62ZvANkWImyVRM4seH4=;
|
||||
_cfuvid=8qN4npFFWXAqn.wugd0jrQ36YkreDcTGH14We.FcBjg-1703102483136-0-604800000
|
||||
host:
|
||||
- api.openai.com
|
||||
user-agent:
|
||||
- OpenAI/Python 1.6.0
|
||||
x-stainless-arch:
|
||||
- arm64
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- MacOS
|
||||
x-stainless-package-version:
|
||||
- 1.6.0
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.11.7
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
content: "{\n \"id\": \"chatcmpl-8Xx2pqWD01uG0roGJ4daSfvaXLchg\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1703102483,\n \"model\": \"gpt-4-0613\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"The human asks the AI for its opinion
|
||||
on AI agents, based on the impression that the AI dislikes them. The AI clarifies
|
||||
that it doesn't hold personal sentiments towards AI or any technology, but instead
|
||||
analyzes them objectively. The AI finds AI agents a fascinating domain of research
|
||||
with great potential for task automation and optimization across industries,
|
||||
but acknowledges they present challenges such as ethical considerations around
|
||||
privacy and decision-making.\"\n },\n \"logprobs\": null,\n \"finish_reason\":
|
||||
\"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 279,\n \"completion_tokens\":
|
||||
81,\n \"total_tokens\": 360\n },\n \"system_fingerprint\": null\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-RAY:
|
||||
- 838a7a17fbb9a4b0-GRU
|
||||
Cache-Control:
|
||||
- no-cache, must-revalidate
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Encoding:
|
||||
- gzip
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Wed, 20 Dec 2023 20:01:29 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
access-control-allow-origin:
|
||||
- '*'
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
openai-model:
|
||||
- gpt-4-0613
|
||||
openai-organization:
|
||||
- user-z7g4wmlazxqvc5wjyaaaocfz
|
||||
openai-processing-ms:
|
||||
- '5872'
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
strict-transport-security:
|
||||
- max-age=15724800; includeSubDomains
|
||||
x-ratelimit-limit-requests:
|
||||
- '10000'
|
||||
x-ratelimit-limit-tokens:
|
||||
- '300000'
|
||||
x-ratelimit-limit-tokens_usage_based:
|
||||
- '300000'
|
||||
x-ratelimit-remaining-requests:
|
||||
- '9999'
|
||||
x-ratelimit-remaining-tokens:
|
||||
- '299610'
|
||||
x-ratelimit-remaining-tokens_usage_based:
|
||||
- '299610'
|
||||
x-ratelimit-reset-requests:
|
||||
- 6ms
|
||||
x-ratelimit-reset-tokens:
|
||||
- 77ms
|
||||
x-ratelimit-reset-tokens_usage_based:
|
||||
- 77ms
|
||||
x-request-id:
|
||||
- bff02b569530c001aa9a2adba9adbeb9
|
||||
http_version: HTTP/1.1
|
||||
status_code: 200
|
||||
version: 1
|
||||
Reference in New Issue
Block a user