langchain/templates/research-assistant/research_assistant/chain.py
Harrison Chase 2ff30b50f2
FEATURE gpt researcher template (#13062)
Co-authored-by: Erick Friis <erick@langchain.dev>
2023-11-13 15:52:25 -08:00

17 lines
432 B
Python

from langchain.pydantic_v1 import BaseModel
from langchain.schema.runnable import RunnablePassthrough
from research_assistant.search.web import chain as search_chain
from research_assistant.writer import chain as writer_chain
chain_notypes = (
RunnablePassthrough().assign(research_summary=search_chain) | writer_chain
)
class InputType(BaseModel):
question: str
chain = chain_notypes.with_types(input_type=InputType)