You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, function call schemas cannot be passed dynamically as variables when configuring OpenAI function calls. This limitation makes it difficult to reuse or dynamically generate schemas in a clean and modular manner. For example, attempting to define a schema in a vars block and reference it in a function configuration results in an output of "parameters":{"[object Object]":null} instead of the expected schema.
This behavior is frustrating as it reduces flexibility and increases redundancy in defining schemas, particularly for use cases where schemas might need to be generated or reused across multiple tools or scenarios.
Describe the solution you'd like
I would like the ability to pass schemas as variables in function call configurations. For instance, the following configuration should work as expected:
providers:
- id: openai:chat:gpt-4o-audio-previewconfig:
tools: [{"type": "function","function": {"name": "transcribe_audio","description": "Transcribe the audio","parameters": {{ schema | dump | safe }}}}]tool_choice: 'auto'tests:
- vars:
schema: {"type": "object","properties": {"transcription": {"type": "string","description": "The transcription of the audio"}},"required": ["transcription"]}
The schema variable should correctly resolve and be passed into the parameters field without breaking.
Describe alternatives you’ve considered
Hardcoding schemas directly into function configurations: While this works, it results in code duplication and makes schema management cumbersome, especially for large projects with multiple tools or similar schema structures.
Preprocessing the configuration: Writing custom scripts to inject schemas before runtime, but this adds unnecessary complexity and reduces the maintainability of configurations.
Neither of these alternatives is as clean or efficient as supporting schema variables natively.
Additional context
Here’s an example of the error observed when attempting to pass a schema variable:
"parameters": {"[object Object]": null}
Allowing schemas to be passed as variables would enable dynamic and modular schema configurations, improving development workflows and reducing redundancy. This feature would be particularly useful for scenarios requiring reusable or dynamically generated function call schemas.
Thank you for considering this feature! Let me know if further clarification or examples are needed.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, function call schemas cannot be passed dynamically as variables when configuring OpenAI function calls. This limitation makes it difficult to reuse or dynamically generate schemas in a clean and modular manner. For example, attempting to define a schema in a
vars
block and reference it in a function configuration results in an output of"parameters":{"[object Object]":null}
instead of the expected schema.This behavior is frustrating as it reduces flexibility and increases redundancy in defining schemas, particularly for use cases where schemas might need to be generated or reused across multiple tools or scenarios.
Describe the solution you'd like
I would like the ability to pass schemas as variables in function call configurations. For instance, the following configuration should work as expected:
The schema variable should correctly resolve and be passed into the
parameters
field without breaking.Describe alternatives you’ve considered
Neither of these alternatives is as clean or efficient as supporting schema variables natively.
Additional context
Here’s an example of the error observed when attempting to pass a schema variable:
Allowing schemas to be passed as variables would enable dynamic and modular schema configurations, improving development workflows and reducing redundancy. This feature would be particularly useful for scenarios requiring reusable or dynamically generated function call schemas.
Thank you for considering this feature! Let me know if further clarification or examples are needed.
The text was updated successfully, but these errors were encountered: