Skip to content

Commit

Permalink
add support for "configurable" langserve argument
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEdmondson1234 committed May 13, 2024
1 parent dacac2d commit 44c01ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

# Define your base version
version = '0.52.1'
version = '0.52.2'

setup(
name='sunholo',
Expand Down
8 changes: 8 additions & 0 deletions sunholo/agents/langserve.py
Expand Up @@ -35,10 +35,18 @@ def prepare_request_data(user_input, endpoint, vector_name, **kwargs):
key = next(iter(input_schema['properties']))
input_data = {key: user_input}

# Check for the special 'configurable' key in kwargs
config_data = {}
if 'configurable' in kwargs:
config_data['configurable'] = kwargs.pop('configurable')

# Merge kwargs into request_data
input_data.update(kwargs)
input_data['vector_name'] = vector_name
request_data = {"input": input_data}
if config_data:
request_data['config'] = config_data

return request_data
else:
log.error("Invalid or no input schema available.")
Expand Down

0 comments on commit 44c01ae

Please sign in to comment.