Skip to content

Commit

Permalink
Update widget (#261)
Browse files Browse the repository at this point in the history
Update the widget to use "output" key
  • Loading branch information
eyurtsev authored Nov 27, 2023
1 parent af904f5 commit 477af9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/conversational_retrieval_chain/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ class ChatHistory(BaseModel):

chat_history: List[Tuple[str, str]] = Field(
...,
extra={"widget": {"type": "chat", "input": "question", "output": "answer"}},
extra={"widget": {"type": "chat", "input": "question", "output": "output"}},
)
question: str


conversational_qa_chain = _inputs | _context | ANSWER_PROMPT | ChatOpenAI()
conversational_qa_chain = (
_inputs | _context | ANSWER_PROMPT | ChatOpenAI() | StrOutputParser()
)
chain = conversational_qa_chain.with_types(input_type=ChatHistory)

app = FastAPI(
Expand Down

0 comments on commit 477af9e

Please sign in to comment.