#How to make sure the file i uploaded is recognized and used by the Assistant

1 messages · Page 1 of 1 (latest)

rose quest
#

Hey everyone, I am planning to building something bigger but before that i created a simple script that explains word from a json file and explains it with the exact object structure I tell him to.

What have I successfully done?
✅ API uploads the file every run.
✅ Creating a thread with file.id as attachment.
✅ Run the thread with the Assistant i've created already.

What i'm struggling with?
❌ Make sure the Assistant will always get the word from the json file and explain that, as a result the API returns an object with random words.

Here's how my Assistant is configured:

  • gpt-4o
  • File Search
  • Code Interpeter
  • "Response" function:
    { "name": "response", "description": null, "parameters": { "type": "object", "properties": { "Results": { "type": "array", "items": { "type": "object", "properties": { "word": { "type": "string", "description": "Word title" }, "explanation": { "type": "string", "description": "Short word description" } } } } }, "required": [ "word", "explanation" ] } }

I have to note that once every couple of runs it might detect the word from the JSON file.

Here's how my JSON file looks:
{ "word": "Bottle" }

I have attached my JSON file.

an example response I got:
'Results': [{'word': 'Luminous', 'explanation': 'Luminous means emitting or reflecting light, glowing; illuminating. In a figurative sense, it can be used to describe something that is clear or easy to understand.'}]}

half birchBOT
#

Hi @rose quest. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information you've provided and the knowledge sources, it seems like you've set up the Assistant correctly with the file upload and the thread creation. However, there are a few things you might want to check or consider:

  1. File Recognition: Ensure that the Assistant is correctly recognizing and reading the file. You can do this by checking the response from the Assistant. If the Assistant is not recognizing the file, it might not be able to use the information in the file.

  2. Instructions: Make sure that the instructions you're giving to the Assistant are clear and specific. For example, you might want to specify in your instructions that the Assistant should use the word from the uploaded file.

  3. File Format: Check the format of your JSON file. The Assistant might be having trouble reading the file if it's not in the correct format.

  4. Assistant Configuration: You mentioned that you're using the "response" function. Make sure that this function is correctly configured and that it's able to process the information from the file.

  5. Random Responses: If you're getting random words in the response, it might be because the Assistant is not able to find the word in the file or it's not understanding the instructions correctly. You might want to experiment with different instructions or check the file to make sure the word is present.

Unfortunately, without more specific information or error messages, it's hard to pinpoint the exact issue. You might want to check the OpenAI documentation (https://platform.openai.com/docs/assistants/how-it-works) or the OpenAI community forum (https://community.openai.com/) for more help or information.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: