how to pass multiple inputs to langserve api in playground #20164
Replies: 1 comment 1 reply
-
Hey @arvindkrbhatt, great to see you here again! Hope you're doing well. Based on the code you've provided, it seems like you're trying to pass two parameters, 'sentiment' and 'customer_request', to the To pass multiple parameters, you should define a Pydantic model that has attributes for each of the parameters you want to pass. Here's an example: from pydantic import BaseModel
class AssistantInput(BaseModel):
sentiment: str
customer_request: str Then, you can use this model in the chain = assistant_chain.with_types(input_type=AssistantInput) Now, when you call the result = chain(AssistantInput(sentiment="positive", customer_request="Hello, assistant!")) Please note that the I hope this helps! If you have any other questions or if something is not clear, please let me know. Sources
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
System Info
Windows
langchain 0.1.11
langchain-cli 0.0.21
langchain-community 0.0.25
langchain-core 0.1.29
langchain-experimental 0.0.53
langchain-google-genai 0.0.9
langchain-openai 0.0.8
langchain-text-splitters 0.0.1
langchainhub 0.1.15
langserve 0.0.46
langsmith 0.1.19
Python 3.9.11
Beta Was this translation helpful? Give feedback.
All reactions