Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

promptfooconfig-multi-tool.yaml 2.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  1. # yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
  2. description: Azure OpenAI Assistant with Multiple Tools
  3. prompts:
  4. - '{{prompt}}'
  5. providers:
  6. - id: azure:assistant:your_assistant_id
  7. label: azure-assistant-multi-tool
  8. config:
  9. apiHost: your-resource-name.openai.azure.com
  10. # Load tools from external file
  11. tools: file://tools/multiple-tools.json
  12. # Function callbacks for each tool
  13. functionToolCallbacks:
  14. get_weather: |
  15. async function(args) {
  16. try {
  17. const parsedArgs = JSON.parse(args);
  18. const location = parsedArgs.location;
  19. const unit = parsedArgs.unit || 'c';
  20. console.log(`Weather request for ${location} in ${unit}`);
  21. // Simple weather response
  22. return JSON.stringify({
  23. location,
  24. temperature: unit === 'c' ? 22 : 72,
  25. unit,
  26. condition: 'sunny',
  27. forecast: 'Clear skies for the next few days.'
  28. });
  29. } catch (error) {
  30. console.error('Error in get_weather function:', error);
  31. return JSON.stringify({ error: String(error) });
  32. }
  33. }
  34. suggest_recipe: |
  35. async function(args) {
  36. try {
  37. const parsedArgs = JSON.parse(args);
  38. const ingredients = parsedArgs.ingredients || [];
  39. console.log(`Recipe requested with ingredients: ${ingredients.join(', ')}`);
  40. // Simple recipe suggestion
  41. return JSON.stringify({
  42. recipe: {
  43. name: "Simple Pasta",
  44. ingredients: ["pasta", "olive oil", "garlic", "salt"],
  45. instructions: "1. Boil pasta\n2. Heat oil and garlic\n3. Toss pasta in oil\n4. Season to taste"
  46. }
  47. });
  48. } catch (error) {
  49. console.error('Error in suggest_recipe function:', error);
  50. return JSON.stringify({ error: String(error) });
  51. }
  52. }
  53. # Vector store configuration for file search
  54. tool_resources:
  55. file_search:
  56. vector_store_ids:
  57. - 'your_vector_store_id'
  58. # Standard parameters
  59. temperature: 0.7
  60. apiVersion: '2024-05-01-preview'
  61. debug: true
  62. tests:
  63. # Multi-tool usage tests
  64. - vars:
  65. prompt: I'm planning to run some LLM evaluations tomorrow. Can you tell me about promptfoo's command line options and also check the weather in San Francisco?
  66. - vars:
  67. prompt: I need information about vector stores in promptfoo, the weather in Tokyo, and a simple pasta recipe for dinner.
  68. - vars:
  69. prompt: How do I set up a promptfoo evaluation? By the way, what's the weather like in Seattle today?
  70. - vars:
  71. prompt: I have pasta and garlic. Can you suggest a recipe and also help me understand how to use custom assertions in promptfoo?
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...