-
Notifications
You must be signed in to change notification settings - Fork 176
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
adding Mistral powered search engine (native RAG and tools calling) #52
Conversation
mistral-search-engine.ipynb
Outdated
} | ||
], | ||
"source": [ | ||
"import session_info\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!pip install session_info is maybe missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session-info is only to display the libraries version, it is not necessary required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just that it makes it more user friendly to be able to just download the notebook and run it on colab without any major changes, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem I will remove it.
mistral-search-engine.ipynb
Outdated
"Traceback (most recent call last):\n", | ||
" File \"/Users/hugolebelzic/miniconda3/envs/mistral-cookbook-contrib/lib/python3.10/site-packages/mistralai/client.py\", line 49, in __del__\n", | ||
" self._client.close()\n", | ||
"AttributeError: 'MistralClient' object has no attribute '_client'\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to handle this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, I ran it again and wasn't able to reproduce this error. Do you have more indications ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the error was fixed by itself, weirdly...
Btw, if possible keep the !pip install for the rest of the required libraries!
Otherwise I think everything is alright.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just added it! everything should be good now
mistral-search-engine.ipynb
Outdated
"while True:\n", | ||
" input_ = input(\"Ask: \")\n", | ||
" messages.append(ChatMessage(role=\"user\", content=input_))\n", | ||
" response = client.chat(model=model, messages=messages, tools=tools, tool_choice=\"auto\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not work if the model decides to not use a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can force the tool choice.
mistral-search-engine.ipynb
Outdated
"while True:\n", | ||
" input_ = input(\"Ask: \")\n", | ||
" messages.append(ChatMessage(role=\"user\", content=input_))\n", | ||
" response = client.chat(model=model, messages=messages, tools=tools, tool_choice=\"auto\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weirdly it seems it was not updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just pushed again, and I actually found the cause of the issue so it is fixed now.
mistral-search-engine.ipynb
Outdated
"while True:\n", | ||
" input_ = input(\"Ask: \")\n", | ||
" messages.append(ChatMessage(role=\"user\", content=input_))\n", | ||
" response = client.chat(model=model, messages=messages, tools=tools, tool_choice=\"force\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force is not an option, maybe 'any'?
And I think thats the only thing, everything else seems to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea sorry you're right I keep getting confused with force and any. Just made the change !
Nice! You can add it to the readme under the mistral section, since this uses mostly our documentation I believe it deserves to be in there and we can merge it! |
This should do, thanks for the contribution! |
Hello,
I've written a search engine based on Mistral large that uses RAG and tools calling from mistral native documentation.