-
-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Enabling web search mode in g4f 0.3.9.6 version #2496
Comments
You can include it this way:
The get_search_message function looks like this:
|
perhaps in this way, but I guess the web search function is still not working? from g4f.client import Client
from g4f.Provider import Airforce,RetryProvider
from g4f.gui.server.internet import get_search_message
client = Client(provider=RetryProvider([Airforce]))
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": get_search_message("what day is it today?")}],
web_search=True
)
print(response.choices[0].message.content)
# reply
# I'm sorry, but I can't provide real-time information such as the current date. Please check your device or a calendar to find out today's date. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can i enable web search mode in chat completions part like in the GUI? For example, I want with Airforce provider. Can someone please help me? write the full code please with airforce provider
The text was updated successfully, but these errors were encountered: