Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request for the class GPTAssistantAgent #747

Closed
Alblahm opened this issue Nov 23, 2023 · 2 comments
Closed

Add request for the class GPTAssistantAgent #747

Alblahm opened this issue Nov 23, 2023 · 2 comments

Comments

@Alblahm
Copy link

Alblahm commented Nov 23, 2023

Is it possible to add the "retrieve" method to the "GPTAssistantAgent" class in a similar way as it supports the "delete" method.

The autogen class "GPTAssistantAgent" supports the "delete_assistant" method, in the same way as the openAI "Assistants" class.
This should be very usefull to allow the users to reuse or modify the created assistants online inside the OpenAI api web, and then just retrieve them from the sample code... Now you can create the assistants, and also you can modify, but you cant recover one previously used assistant.

Example from the autogen "agentchat_oai_assistant_retrieval.ipynb"

If you try to replace the code that creates one GPTAssistantAgent, using the OpenAI retrieve, it does not work ...

# ORIGINAL CODE
gpt_assistant = GPTAssistantAgent(name="assistant",
                                instructions="You are adapt at question answering",
                                llm_config=llm_config)

user_proxy.initiate_chat(gpt_assistant, message="What is the name of the class of agents I gave you?")
# TRY to import from OPENAI web ...
from openai import OpenAI
client = OpenAI(
  organization='org-XXXXXXXX', api_key="sk-XXXXXXXXXXXXXX",
)
gpt_assistant = client.beta.assistants.retrieve("asst_XXXXXXXXX")
user_proxy.initiate_chat(gpt_assistant, message="What is the name of the class of agents I gave you?")

The second code does not work, probably because you have to cast the agent from one type to the other. But it sould be interesting for the autogen assistants to include the option of recovering the assistants previously saved.

@gagb
Copy link
Collaborator

gagb commented Nov 29, 2023

@Alblahm, This was addressed in #718?

@gagb
Copy link
Collaborator

gagb commented Jan 29, 2024

was addressed.

@gagb gagb closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants