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
with openapi spec use object param which defines required parameters at the object level using a separate required array.
Error Message and Stack Trace (if applicable)
No response
Description
Currently, the function convertOpenAPISchemaToJSONSchema identifies required parameters only if they are marked with "required": true directly within their property definition.
However, JSON Schema also defines required parameters at the object level using a separate required array, listing the names of properties that are required. Because of this, convertOpenAPISchemaToJSONSchema function might overlook parameters listed in the required array at the object level and therefore not include them as required when constructing API calls.
Examples:
It does take into account only params with defined required=true attribute
With login we wont get pageNum as a required field and later llm wont provide values for required params as function doen't know that it's required param.
Current implementation will consider only fields with required in the definition of each field, as in this example:
Hey there, @ikalachy! I'm here to assist you with any bugs, questions, or contributions you might have. Let's tackle this issue together.
The function convertOpenAPISchemaToJSONSchema in LangChain.js currently does not account for required parameters defined at the object level using a separate required array. It only checks for the required property within each individual property schema. This means that parameters listed in the required array at the object level are overlooked and not included as required when constructing API calls.
The function iterates over the properties of the object and converts each property schema individually. It only adds properties to the required array if the required property is set within the individual property schema, not if it is set at the object level [1].
Checked other resources
Example Code
with openapi spec use object param which defines required parameters at the object level using a separate required array.
Error Message and Stack Trace (if applicable)
No response
Description
Currently, the function convertOpenAPISchemaToJSONSchema identifies required parameters only if they are marked with "required": true directly within their property definition.
However, JSON Schema also defines required parameters at the object level using a separate required array, listing the names of properties that are required. Because of this, convertOpenAPISchemaToJSONSchema function might overlook parameters listed in the required array at the object level and therefore not include them as required when constructing API calls.
Examples:
It does take into account only params with defined required=true attribute
With login we wont get pageNum as a required field and later llm wont provide values for required params as function doen't know that it's required param.
Current implementation will consider only fields with required in the definition of each field, as in this example:
System Info
mac
% node --version
v18.18.2
% yarn --version
1.22.22
The text was updated successfully, but these errors were encountered: