# Use the Reddit image URL image_urls = [ "https://i.redd.it/7gyrosc13tme1.jpeg" ] # Load the image from URL image_documents = load_image_urls(image_urls) # Initialize Gemini llm = Gemini(model="models/gemini-2.0-flash") # Ask the model to describe the image response = llm.complete( prompt="Describe this image in detail. What does it show?", image_documents=image_documents )
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=[])
|
type annotation it throws another errortools
parameter 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)
FieldInfo
no the actual default
value when i call the function with code, is there any better way?