Skip to content

Conversation

@jezekra1
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jezekra1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to the context management system by allowing contexts to be optionally linked to a specific provider. This enables better organization and filtering of contexts based on their origin or associated service, improving the overall flexibility and utility of the context feature. The changes span the entire stack, from the database schema and API to the SDK and comprehensive testing.

Highlights

  • Context Model Enhancement: The Context model across the SDK, API schema, and domain now includes an optional provider_id field, allowing contexts to be associated with a specific provider.
  • API and SDK Updates: The Context.create and Context.list methods in the Python SDK, as well as the corresponding API endpoints (/api/v1/contexts for POST and GET), have been updated to support the new optional provider_id parameter for creation and filtering.
  • Database Migration: A new Alembic migration script has been added to introduce a nullable provider_id column to the contexts table, with a foreign key constraint linking it to the providers table and configured for cascading deletes.
  • Service and Repository Logic: The service and persistence layers have been updated to handle the provider_id during context creation and to enable filtering contexts by provider_id when listing them.
  • End-to-End Testing: New end-to-end tests have been added to validate the functionality of creating contexts with and without provider_id and to ensure correct filtering of contexts based on the provider_id.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 introduces an optional provider_id to the context model and related functionalities. This allows contexts to be associated with specific providers, enabling filtering and better organization of contexts. The changes include modifications to the data models, API schemas, service layer, persistence layer, and e2e tests to accommodate the new provider_id field. I have identified a few areas where improvements can be made to ensure code quality and clarity.

async def create(
*,
metadata: Metadata | None = None,
provider_id: str | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider using Optional[str] instead of str | None for better readability and consistency with other type hints in this file.

Suggested change
provider_id: str | None = None,
provider_id: typing.Optional[str] = None,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tell me, where else in this file is Optional type hint?

@jezekra1 jezekra1 force-pushed the add-context-provider-id-filter branch from 75cde5b to 052d331 Compare October 22, 2025 12:17
@jezekra1 jezekra1 force-pushed the add-context-provider-id-filter branch from 052d331 to f94fc22 Compare October 22, 2025 12:58
@jezekra1 jezekra1 merged commit bc15097 into main Oct 22, 2025
10 checks passed
@jezekra1 jezekra1 deleted the add-context-provider-id-filter branch October 22, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants