mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 06:53:16 +00:00
FEATURE gpt researcher template (#13062)
Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
16
templates/research-assistant/research_assistant/chain.py
Normal file
16
templates/research-assistant/research_assistant/chain.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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)
|
Reference in New Issue
Block a user