Find answers from the community

F
Fremko
Offline, last seen last week
Joined January 21, 2025
F
Fremko
·

Tools

gemini also lacks text blocks when performing function calls
Plain Text
ChatMessage(role=<MessageRole.USER: 'user'>, additional_kwargs={}, blocks=[TextBlock(block_type='text', text='I want you to create a paste of your choice about global warming and then shorten the link of the paste and paste it to my clipboard')]),



 ChatMessage(role=<MessageRole.ASSISTANT: 'assistant'>, additional_kwargs={'tool_calls': [name: "create_paste"
 args {
   fields {
     key: "paste_code"
     value {
       string_value: "Global warming is a serious threat to our planet. We must take action to reduce our carbon footprint and protect our environment."
     }
   }
   fields {
     key: "name"
     value {
       string_value: "Global Warming Awareness"
     }
   }
 }
 ]}, blocks=[])
20 comments
L
F
F
Fremko
·

Scroll

forexample this error
3 comments
L
F
F
Fremko
·

Gemini

gemini function calling is very hard to debug, lots of errors that are hard to figure out.

if parameter doesnt have type annotation, it throws an error.
if parameter has union or | type annotation it throws another error

and there are a few other errors that i have came across.
2 comments
L
is there a way to log http requests and responses (as an http request)? there doesnt seem to be any way of doing it through events and dispatchers @kapa.ai
1 comment
k
F
Fremko
·

Tools

currently this is what i am using to pass description to tools parameter
Plain Text
from pydantic import Field

def get_weather(
    location: str = Field(default="australia"
        description="A city name and state, formatted like '<name>, <state>'"
    ),
) -> str:
    """Useful for getting the weather for a given location."""
    # Function implementation

tool = FunctionTool.from_defaults(get_weather)


however i would no longer be able to use the default values because they are passed as FieldInfo no the actual default value when i call the function with code, is there any better way?
4 comments
L
F
F
Fremko
·

Docs

it keeps scrolling up to the top every now and then
7 comments
L
F