mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-07 14:03:26 +00:00
Force List[Tuple[str,str]] to chat history widget (#12530)
Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ from langchain.schema.runnable import (
|
||||
RunnablePassthrough,
|
||||
)
|
||||
from langchain.vectorstores import Pinecone
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
if os.environ.get("PINECONE_API_KEY", None) is None:
|
||||
raise Exception("Missing `PINECONE_API_KEY` environment variable.")
|
||||
@@ -87,7 +87,7 @@ def _format_chat_history(chat_history: List[Tuple[str, str]]) -> List:
|
||||
|
||||
# User input
|
||||
class ChatHistory(BaseModel):
|
||||
chat_history: List[Tuple[str, str]]
|
||||
chat_history: List[Tuple[str, str]] = Field(..., extra={"widget": {"type": "chat"}})
|
||||
question: str
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user