https://promptfoo.dev/ logo
Importing provider tools from a file
# ❓|questions
n
Hello everyone ! I have already opened a bug issue for this [here](https://github.com/promptfoo/promptfoo/issues/1311). However, in the mean time, i was wondering how you were managing tools. They tend to get quite long and i'd also like to reduce duplication as much as possible. Any insights are welcome 🙂
i
another thought, one thing that is available today is providers can be loaded from separate files. so even if you can't split out the tools, you can split out the providers, which hopefully makes things a bit more manageable
n
Thank you very much !
Regarding separating in multiple files, i've had this issue : https://github.com/promptfoo/promptfoo/issues/1307 which made me rethink how i organized my stuff
Hey @User ! Not sure if i'm doing something wrong but i don't understand how to use it. I am using the latest version which for now is (0.74.0) Here is the code :
Copy code
yaml
  - id: openai:chat:gpt-4o-mini
    config:
      label: gpt-4o-mini
      temperature: 0
      max_tokens: 1024
      tool_choice: 'auto'
      tools:
        - file://./tool-event-api.json
tool-event-api.json (i also tried yml format here)
Copy code
json
{
  "type": "function",
  "function": {
    "name": "event_api",
    ...
  }
}
Here is the error i get : https://cdn.discordapp.com/attachments/1268551965357641728/1268870170215190538/image.png?ex=66adfeef&is=66acad6f&hm=df75cb8996213d6146e81cb9987f0c05037734c7a196804d927d195201cf9459&
When looking up the value from a python script, here is what i get :
Copy code
'tools': ['file://./tool-event-api.txt']
Instead of the file content
i
hmm... will take a look
2 Views