We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to modify request body to send to the model, is there a way to use pydantic to modify input_type
for example this is the default req body:
{ "inputs": [ "string" ], "config": {}, "kwargs": {} }
i want to change like this:
{ "inputs": [ "string" ], "config": {}, "kwargs": {}, "metadata":["string"] }
because i want to get the value inside the metadata for filtering rag document.
here are my chain
chain = ( {"context": retriever | RunnablePassthrough(), "task": RunnablePassthrough()} | pipeline_prompt | llm | parser ) class InputPrompt(BaseModel): __root__: str chain = chain.with_types(input_type=InputPrompt)
and I'm using APIHandler to make batch and invoke method:
async def batch_api(api_chain, path: str, request: Request) -> Response: """ Handle a request for the specified API. """ api_handler = APIHandler(api_chain, path=path) return await api_handler.batch(request, server_config=langfuse_config)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to modify request body to send to the model, is there a way to use pydantic to modify input_type
for example this is the default req body:
i want to change like this:
because i want to get the value inside the metadata for filtering rag document.
here are my chain
and I'm using APIHandler to make batch and invoke method:
The text was updated successfully, but these errors were encountered: