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
I've encountered an issue where the default value for extra_body in the configurable field is being lost when LangServe generates the API documentation. This results in the API expecting the client to explicitly provide the extra_body value, which should not be necessary as it should have a server-side default.
Steps to Reproduce:
Create a runnable with a default extra_body configuration:
It lost the QuotedAnswer.schema_json(ensure_ascii=False) value
Expected Behavior:
The API documentation should show the default value for extra_body in the configurable field, and the server should use this default value if not provided by the client.
Actual Behavior:
The API documentation shows extra_body as None, and the server expects the client to provide the extra_body value explicitly.
Additional Information:
When debugging, I found that the incoming_config in the _unpack_request_config function already has extra_body set to None:
pythonCopy{'configurable': {'extra_body': None, 'llm': 'vllm', 'llm_temperature': 0.0, 'search_kwargs': {'expr': 'patient_id == "EY1006608"'}}}
The issue seems to occur during the API documentation generation process, as the default value is lost at this stage.
Attempted Solutions:
Checked and confirmed that the runnable's initial configuration correctly includes the extra_body value.
Tried modifying the APIHandler class to set a default value for extra_body if it's None.
Explored using custom ConfigurableField to always provide a default value.
Attempted to modify the add_routes function to include default value handling.
None of these solutions have resolved the issue. The default value is still not being reflected in the API documentation or being used by the server when not provided by the client.
Environment:
Description:
I've encountered an issue where the default value for
extra_body
in theconfigurable
field is being lost when LangServe generates the API documentation. This results in the API expecting the client to explicitly provide theextra_body
value, which should not be necessary as it should have a server-side default.Steps to Reproduce:
Create a runnable with a default
extra_body
configuration:Add routes using LangServe's add_routes function.
the example value is
It lost the QuotedAnswer.schema_json(ensure_ascii=False) value
Expected Behavior:
The API documentation should show the default value for extra_body in the configurable field, and the server should use this default value if not provided by the client.
Actual Behavior:
The API documentation shows extra_body as None, and the server expects the client to provide the extra_body value explicitly.
Additional Information:
When debugging, I found that the incoming_config in the _unpack_request_config function already has extra_body set to None:
pythonCopy{'configurable': {'extra_body': None, 'llm': 'vllm', 'llm_temperature': 0.0, 'search_kwargs': {'expr': 'patient_id == "EY1006608"'}}}
The issue seems to occur during the API documentation generation process, as the default value is lost at this stage.
Attempted Solutions:
Checked and confirmed that the runnable's initial configuration correctly includes the extra_body value.
Tried modifying the APIHandler class to set a default value for extra_body if it's None.
Explored using custom ConfigurableField to always provide a default value.
Attempted to modify the add_routes function to include default value handling.
None of these solutions have resolved the issue. The default value is still not being reflected in the API documentation or being used by the server when not provided by the client.
Environment:
LangServe version: 0.2.2
LangChain version: 02.2
Python version: 3.10
The text was updated successfully, but these errors were encountered: