Trying to create a new assistant with custom actions (so it can call an external API). The URL containing the OpenAPI definition seems to load correctly, and then when I configure the Authentication part (with OAuth) and save, I get this error:
“Couldn’t save OpenAPI spec due to errors:
Could not find a valid URL in servers”
assistant = client.beta.assistants.create(
name=“Andy”,
instructions=“Eres un asistente ejecutivo. Usa las funciones para dar respuesta a las preguntas.”,
model=“gpt-4-1106-preview”,
tools=[
{
“type”: “function”,
“function”: {
“name”: “getInventory”,
“description”: “Esta funcion consulta el stock de productos en todos los depositos”,
“parameters”: {
“type”: “object”,
“properties”: {
“sku”: {“type”: “string”, “description”: “Código del producto”},
“color”: {“type”: “string”, “description”: “Color”},
“talle”: {“type”: “string”, “enum”: [“1”, “2”, “3”, “4”, “085”, “090”, “095”, “100”, “105”]},
“warehouse”: {“type”: “string”, “enum”: [“Local Pocitos”, “Principal”, “Transito”]},
},
“required”: [“sku”, “warehouse”]
}
}
},
{
“type”: “function”,
“function”: {
“name”: “getSales”,
“description”: “Query backoffice system to get sales information”,
“parameters”: {
“type”: “object”,
“properties”: {
“sku”: {“type”: “string”, “description”: "Product code, if not specified all products will be assumed "},
“period”: {“type”: “string”, “description”: “date or named period of sales if not specified month to date will be assumed”},
“seller”: {“type”: “string”, “enum”: [“Fabiana”, “Ecommerce”, “Mabel”, “Beatriz”]},
},
Hi @martin.otero, generally for long running processes (where you can’t block and wait for a result), like we are discussing, webhook is the standard and the recommended way of doing so. Calling a webhook endpoint from OpenAI end is not a “massive” thing to do. On the user part, you just supply OpenAI with the endpoint to call. When you receive a message, you may verify that it is coming from OpenAI (OpenAi will setup the verification process), once you’ve verified the source and it is from OpenAI, you can then process the payload. That’s the standard way of incorporating webhook in a process flow. It’s not an overkill process and it is very easy to implement.
Well maybe I exaggerated. I think it would depend on the scope of the processes. If you are processing an external call then a webhook is the callback or you are processing an internal function where await callback should do. I was thinking on the latter