experimental[patch], docs: refine notebook for MyScale SelfQueryRetriever (#22016)

- **Description:** upgrade model to `gpt-4o`
This commit is contained in:
mochi
2024-05-23 05:49:01 +08:00
committed by GitHub
parent d948783a4c
commit 63284ffebf
2 changed files with 6 additions and 4 deletions

View File

@@ -162,12 +162,14 @@
"source": [
"from langchain.chains.query_constructor.base import AttributeInfo\n",
"from langchain.retrievers.self_query.base import SelfQueryRetriever\n",
"from langchain_openai import OpenAI\n",
"from langchain_openai import ChatOpenAI\n",
"\n",
"metadata_field_info = [\n",
" AttributeInfo(\n",
" name=\"genre\",\n",
" description=\"The genres of the movie\",\n",
" description=\"The genres of the movie. \"\n",
" \"It only supports equal and contain comparisons. \"\n",
" \"Here are some examples: genre = [' A '], genre = [' A ', 'B'], contain (genre, 'A')\",\n",
" type=\"list[string]\",\n",
" ),\n",
" # If you want to include length of a list, just define it as a new column\n",
@@ -193,7 +195,7 @@
" ),\n",
"]\n",
"document_content_description = \"Brief summary of a movie\"\n",
"llm = OpenAI(temperature=0)\n",
"llm = ChatOpenAI(temperature=0, model_name=\"gpt-4o\")\n",
"retriever = SelfQueryRetriever.from_llm(\n",
" llm, vectorstore, document_content_description, metadata_field_info, verbose=True\n",
")"