From 1bdfc5d6c43b1ea5f488ebfa63f659006bfff48b Mon Sep 17 00:00:00 2001 From: DamyanBG Date: Thu, 29 May 2025 09:03:32 +0300 Subject: [PATCH] fix type annotation for call openai function --- notebooks/module_0/rag_application.ipynb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notebooks/module_0/rag_application.ipynb b/notebooks/module_0/rag_application.ipynb index 750c288..96def06 100644 --- a/notebooks/module_0/rag_application.ipynb +++ b/notebooks/module_0/rag_application.ipynb @@ -70,12 +70,13 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from langsmith import traceable\n", "from openai import OpenAI\n", + "from openai.types.chat.chat_completion import ChatCompletion\n", "from typing import List\n", "import nest_asyncio\n", "from utils import get_vector_db_retriever\n", @@ -127,7 +128,7 @@ "@traceable(run_type=\"llm\")\n", "def call_openai(\n", " messages: List[dict], model: str = MODEL_NAME, temperature: float = 0.0\n", - ") -> str:\n", + ") -> ChatCompletion:\n", " return openai_client.chat.completions.create(\n", " model=model,\n", " messages=messages,\n",