def test_convert_llama_index_schema_to_gemini_function_declaration(
    llm: GoogleGenAI,
) -> None:
    """Test conversion of a llama_index schema to a gemini function declaration."""
    function_tool = get_function_tool(Poem)
    # this is our baseline, which is not working because:
    # 1. the descriptions are missing
    google_openai_function = types.FunctionDeclaration.from_callable(
        client=llm._client,
        callable=function_tool.metadata.fn_schema,  # type: ignore
    )

    assert google_openai_function.description == "A simple poem."

    # this is our custom conversion that can take a llama index: fn_schema and convert it to a gemini compatible
    # function declaration (subset of OpenAPI v3)
    converted = convert_schema_to_function_declaration(llm._client, function_tool)

    assert converted.name == "Poem"
    assert converted.description == "A simple poem."
    assert converted.parameters.required is not None

    assert converted.parameters
Test conversion of a llama_index schema to a gemini function declaration.
llama-index-integrations/llms/llama-index-llms-google-genai/tests/test_llms_google_genai.py