From 3b30669d9006515d6fbc7b6573a4437f0d66c59a Mon Sep 17 00:00:00 2001 From: Matt Ferrante Date: Mon, 16 Dec 2024 22:03:08 -0700 Subject: [PATCH] Update chat_app.py --- pydantic_ai_examples/chat_app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pydantic_ai_examples/chat_app.py b/pydantic_ai_examples/chat_app.py index cb5b24c8..f2a50894 100644 --- a/pydantic_ai_examples/chat_app.py +++ b/pydantic_ai_examples/chat_app.py @@ -136,9 +136,10 @@ async def stream_messages(): return StreamingResponse(stream_messages(), media_type='text/plain') -MessageTypeAdapter: TypeAdapter[ModelMessage] = TypeAdapter( - Annotated[ModelMessage, Field(discriminator='message_kind')] -) +# MessageTypeAdapter: TypeAdapter[ModelMessage] = TypeAdapter( +# Annotated[ModelMessage, Field(discriminator='message_kind')] +# ) + P = ParamSpec('P') R = TypeVar('R') @@ -223,5 +224,5 @@ async def _asyncify( import uvicorn uvicorn.run( - 'pydantic_ai_examples.chat_app:app', reload=True, reload_dirs=[str(THIS_DIR)] + 'chat_app:app', reload=True, reload_dirs=[str(THIS_DIR)] )