Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There should be a RequestOptions TypedDict to explain what attributes are allowed. #223

Closed
MarkDaoust opened this issue Mar 1, 2024 · 1 comment · Fixed by #297
Closed
Assignees
Labels
component:python sdk Issue/PR related to Python SDK type:feature request New feature request/enhancement

Comments

@MarkDaoust
Copy link
Collaborator

Description of the feature request:

There shuld be a RequestOptions TypedDict to explain what attributesd are allowed.

What problem are you trying to solve with this feature?

No response

Any other information you'd like to share?

No response

@MarkDaoust MarkDaoust added type:feature request New feature request/enhancement component:python sdk Issue/PR related to Python SDK labels Mar 1, 2024
@MarkDaoust MarkDaoust changed the title There shuld be a RequestOptions TypedDict to explain what attributesd are allowed. There shuld be a RequestOptions TypedDict to explain what attributes are allowed. Mar 1, 2024
@singhniraj08 singhniraj08 added the status:triaged Issue/PR triaged to the corresponding sub-team label Mar 7, 2024
@aidoskanapyanov
Copy link
Contributor

Hi @MarkDaoust! I can help out with this issue if it's available.
Is it alright if I write a typeddict for each request type (i.e. client func call)?

For example:

class GetModelRequestOptionsDict(TypedDict):
    """Request options for the `get_model` method."""

    name: Optional[str]
    retry: OptionalRetry
    timeout: Union[float, object]
    metadata: Sequence[Tuple[str, str]]


class ListModelsRequestOptionsDict(TypedDict):
    """Request options for the `list_models` method."""

    page_size: Optional[int]
    page_token: Optional[str]
    retry: OptionalRetry
    timeout: Union[float, object]
    metadata: Sequence[Tuple[str, str]]


class GetTunedModelRequestOptionsDict(TypedDict):
    """Request options for the `get_tuned_model` method."""

    name: Optional[str]
    retry: OptionalRetry
    timeout: Union[float, object]
    metadata: Sequence[Tuple[str, str]]


class ListTunedModelsRequestOptionsDict(TypedDict):
    """Request options for the `list_tuned_models` method."""

    page_size: Optional[int]
    page_token: Optional[str]
    retry: OptionalRetry
    timeout: Union[float, object]
    metadata: Sequence[Tuple[str, str]]
...

Here is the list of all client method signatures that I've extracted from google.ai.generativelanguage.

@MarkDaoust MarkDaoust changed the title There shuld be a RequestOptions TypedDict to explain what attributes are allowed. There should be a RequestOptions TypedDict to explain what attributes are allowed. May 17, 2024
@github-actions github-actions bot removed the status:triaged Issue/PR triaged to the corresponding sub-team label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK type:feature request New feature request/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants