Skip to content

Minor improvements to Python SDK.#1011

Merged
nan-yu merged 1 commit intogoogle:mainfrom
jgindin:python-sdk-improvements
Mar 27, 2026
Merged

Minor improvements to Python SDK.#1011
nan-yu merged 1 commit intogoogle:mainfrom
jgindin:python-sdk-improvements

Conversation

@jgindin
Copy link
Copy Markdown
Collaborator

@jgindin jgindin commented Mar 27, 2026

Description

  1. Introduce some constants instead of hard-coding strings.

  2. Removing unused parameter

  3. Gemini has fixed a discrepency in the client_ui_capabilities. It found a technical mismatch within the Python SDK itself between the interface and its implementation.

    Specifically: - The Interface (inference_strategy.py) defined generate_system_prompt with the parameter: supported_catalog_ids: List[str] = [] - The Implementation (core/schema/manager.py) actually overrode it using: client_ui_capabilities: Optional[dict[str, Any]] = None and relied heavily on that dictionary to prune and select catalogs.

  4. Working on the Kotlin SDK, the LLM decided to use "smart quotes". Add support for fixing this in case it happens again.

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces hardcoded schema block delimiters with constants and introduces a normalization step in the payload fixer to handle smart quotes, improving parsing reliability. It also updates the generate_system_prompt signature to use client_ui_capabilities instead of supported_catalog_ids and refactors internal validation logic by removing an unused parameter. I have no feedback to provide.

1. Introduce some constants instead of hard-coding strings.
2. Removing unused parameter
3. Gemini has fixed a discrepency in the `client_ui_capabilities`.
   It found a technical mismatch within the Python SDK itself between
   the interface and its implementation.

   Specifically:
     - The Interface (inference_strategy.py) defined
       generate_system_prompt with the parameter:
         supported_catalog_ids: List[str] = []
     - The Implementation (core/schema/manager.py) actually overrode it
       using:
         client_ui_capabilities: Optional[dict[str, Any]] = None
       and relied heavily on that dictionary to prune and select
       catalogs.

4. Working on the Kotlin SDK, the LLM decided to use "smart quotes".
   Add support for fixing this in case it happens again.
@jgindin jgindin force-pushed the python-sdk-improvements branch from 4380520 to 2e61085 Compare March 27, 2026 18:34
Copy link
Copy Markdown
Collaborator

@nan-yu nan-yu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes.

@nan-yu nan-yu merged commit 7b73d77 into google:main Mar 27, 2026
11 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants