How to "store" assistants in platform.openai.com/assistants

Is possible to store an ASSISTANT in openai ui assistant builder after creating it using code ?

I’ll try to explain myself better.

I would like to use some code to create ASSISTANTS like this:

assistant = client.beta.assistants.create(
   name="Data visualizer",
   description="You are great at creating beautiful data visualizations. You analyze data present in .csv files, understand trends, and come up with data visualizations relevant to those trends. You also share a brief text summary of the trends observed.",
   model="gpt-4-1106-preview",
   tools=[{"type": "code_interpreter"}],
   file_ids=[file.id]
)

And after creating it, is it possible to see or test it in the ASSISTANT PLAYGROUND?

Yes if you create them programmatically they end up in the same place and you can use them in the playground.

I use the programmatic option to help with adding the function calls which is tedious.

2 Likes

[I have created an Assistant using the opanAI python library. It not showing https://platform.openai.com/assistants]

logs

2024-02-17 22:18:10,441 - logs.AppLogger - INFO - Application start
2024-02-17 22:19:01,456 - logs.AppLogger - INFO - Application start
2024-02-17 22:19:02,463 - logs.AppLogger - INFO - Assistant(id=‘asst_ot3aMFemjyH7u7gnLOAzAMh2’, created_at=1708188541, description=None, file_ids=, instructions=‘You are a personal math tutor. When asked a question, write and run Python code to answer the question.’, metadata={}, model=‘gpt-3.5-turbo-0125’, name=‘Assistant from code’, object=‘assistant’, tools=[ToolCodeInterpreter(type=‘code_interpreter’)])
2024-02-17 22:20:27,875 - logs.AppLogger - INFO - Application start
2024-02-17 22:20:28,817 - logs.AppLogger - INFO - Assistant(id=‘asst_YWeeFrbqZ8bUVWTDOjAM9RGK’, created_at=1708188627, description=None, file_ids=, instructions=‘You are a personal math tutor. When asked a question, write and run Python code to answer the question.’, metadata={}, model=‘gpt-3.5-turbo-16k’, name=‘Assistant from code gpt-3.5-turbo-16k’, object=‘assistant’, tools=[ToolCodeInterpreter(type=‘code_interpreter’)])

Check what API key you are using in the code and check that the key is visible in your account.

Too bad this thread received no responses from the OP or the additional poster to know if it was resolved and how.

In any case I too have got this issue, looking for resolution.
Note - I am a part of an organization, using my API key and the organization key in the headers of the requests.

  • If I create an Assistant using the platform webUI, trying to access this assistant by running a thread with its asst_id I get:
No assistant found with id: asst_id....

It is also not available in the assistants list when calling GET https://api.openai.com/v1/assistants

  • If I create an Assistant using the API POST https://api.openai.com/v1/assistants it is available when getting the assistants list, and works with thread run, but does not appear in the platform webUI.

Does anyone know if it should’ve worked at all?

You would want to first create a thread and then run it against an assistant. This works for me if I create an assistant through the UI or the API.

        const ai = new OpenAI({
			apiKey: env.OPENAI_API_KEY,
			organization: env.OPENAI_ORGANIZATION_ID
		    });
		const thread = await ai.beta.threads.create();

		await ai.beta.threads.messages.create(thread.id, {
				role: 'user',
				content: JSON.stringify(content)
			});

		 const run = await ai.beta.threads.runs.create(thread.id, {
				assistant_id: `YOUR_ASSISTANT_ID` 
			});

Please provide a code example if you are still having issues

When in the web UI are you 100% sure that the assistant you create is created in the same PROJRCT as your key. You probably have a ‘default project’ which is what was ‘no project’ before the api keys were all specifically part of project. So I think you might have to switch in the UI (top left) to the project your api key is in and then create the assistant?

2 Likes

Oh you are correct! Thank you!

TL;DR - when I created an assistant in the UI, it was in the Default Project, and the key was assigned to a new project I was not aware of, hence the difference between the UI and API.

This is my first time using the API, and my admin just told me he created an API key for me, and he didn’t mention he created a specific project for this key, so I was not aware that keys in the organization have access to specific projects and not the entire org, while the UI user can access all projects and watch all related data…
Learning something new every day :slight_smile:

1 Like

@ntg69 thanks for the reply, I did create a thread and ran it against an assistant, the problem was that the API key was assigned to a different project than the one I created the assistant on. :man_shrugging:

1 Like