Skip to content
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

Special Utility objects #17

Closed
Justarandomgu opened this issue May 30, 2024 · 1 comment
Closed

Special Utility objects #17

Justarandomgu opened this issue May 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Justarandomgu
Copy link

Justarandomgu commented May 30, 2024

When I ask gemini for weather information it responses with a utility object show everything in a gui object.
This thing when asked in the terminal replies with a strange link.

User: How is today's weather? ``AI: http://googleusercontent.com/card_content/0

Try it yourself... here is the code:

import asyncio
from gemini_webapi import GeminiClient
from config import Secure_1PSID, Secure_1PSIDTS

client = GeminiClient(Secure_1PSID, Secure_1PSIDTS, proxies=None)

async def init():
    await client.init(timeout=30, auto_close=False, auto_refresh=True)

async def send_message_bot():
    chat = client.start_chat()
    while True:
        try:
            prompt = input("User: ")
            response = await chat.send_message(prompt))
            print(response.text)
        except KeyboardInterrupt:
            print("\nExiting...")
            exit(0)

asyncio.run(init())
asyncio.run(send_message_bot())

Make sure to replace the cookies

@HanaokaYuzu HanaokaYuzu added the enhancement New feature or request label May 30, 2024
@HanaokaYuzu
Copy link
Owner

Looks like Google is cooperating with external service providers (weather.com in this case) and replacing Gemini's text output with card contents on certain topics.

For now I'll add a workaround to output fallback text in ModelOutput, but it will be just kinda short summary. If more such cases are reported, the output structure may be updated to fit these kinds of card contents.

You may would like to add more instructions to your input (like "use text only") for better result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants