Skip to content

fix type annotation for call openai function #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions notebooks/module_0/rag_application.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down