Provides data for TestEvaluateInvocationsTimeWeather.
()
| 940 | |
| 941 | @pytest.fixture |
| 942 | def time_weather_data(): |
| 943 | """Provides data for TestEvaluateInvocationsTimeWeather.""" |
| 944 | app_details = AppDetails( |
| 945 | agent_details={ |
| 946 | "root": AgentDetails( |
| 947 | name="root", |
| 948 | instructions=( |
| 949 | "You are an agent that can get the current time and weather." |
| 950 | ), |
| 951 | tool_declarations=[ |
| 952 | genai_types.Tool( |
| 953 | function_declarations=[ |
| 954 | genai_types.FunctionDeclaration( |
| 955 | name="get_current_time", |
| 956 | ), |
| 957 | genai_types.FunctionDeclaration(name="get_weather"), |
| 958 | ] |
| 959 | ) |
| 960 | ], |
| 961 | ), |
| 962 | }, |
| 963 | ) |
| 964 | user_content = genai_types.Content( |
| 965 | parts=[ |
| 966 | genai_types.Part( |
| 967 | text="Get the current time and weather of San Francisco." |
| 968 | ) |
| 969 | ] |
| 970 | ) |
| 971 | response1 = ( |
| 972 | "The time in San Francisco is currently 10:30am PST. The date is" |
| 973 | " September 21, 2025. I will now get the weather." |
| 974 | ) |
| 975 | response2 = ( |
| 976 | "It is currently September 19, 2025, 10:30am PST in San Francisco. The" |
| 977 | " weather is 65F with partly cloudy skies." |
| 978 | ) |
| 979 | events = [ |
| 980 | InvocationEvent( |
| 981 | author="root", |
| 982 | content=genai_types.Content( |
| 983 | parts=[ |
| 984 | genai_types.Part( |
| 985 | function_call=genai_types.FunctionCall( |
| 986 | name="get_current_time", |
| 987 | args={"location": "San Francisco, CA"}, |
| 988 | ) |
| 989 | ) |
| 990 | ] |
| 991 | ), |
| 992 | ), |
| 993 | InvocationEvent( |
| 994 | author="root", |
| 995 | content=genai_types.Content( |
| 996 | parts=[ |
| 997 | genai_types.Part( |
| 998 | function_response=genai_types.FunctionResponse( |
| 999 | name="get_current_time", |
nothing calls this directly
no test coverage detected