How To: Tool which uses GPT4 chat completion #2363
Unanswered
WebsheetPlugin
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You can do: from autogen import OpenAIWrapper
client = OpenAIWrapper()
response = client.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
) For the nested chat discussion, please refer to #2223 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not sure how to do it in Autogen, but I am looking for an easy way, to call via OpenAI's GPT4 chat completion with some specific instructions, then still inside the tool, I want to use this information to do some processes and only then return some result from the tool.
I have checked "oai.client", but this looks like the old completions and not the new chat completion API.
Or can I use it like https://platform.openai.com/docs/guides/text-generation/chat-completions-api here?
And it will still allow me to still use:
Also, these nested chats seem way too complicated for me. For me, it's not really clear why I should use it in this case. As I am not looking for some kind of inner conversation.
Beta Was this translation helpful? Give feedback.
All reactions