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

Use actual function name in get_schema_from_signature #875

Closed
wants to merge 1 commit into from

Conversation

leloykun
Copy link
Contributor

@leloykun leloykun commented May 7, 2024

As discussed with @eitanturok in #863


Currently, get_schema_from_signature converts the following function:

def test_add(a: int, b: int | None = None):
    if b is None:
        return a
    return a + b

to the schema:

{
    "properties": {
        "a": {"title": "A", "type": "integer"},
        "b": {"title": "B", "type": "integer"},
    },
    "required": ["a"],
    "title": "Arguments",
    "type": "object",
}

The issue is that the title of the schema is always "Arguments", regardless of the name of the function. And in some cases, this breaks the performance of the model as discussed by @eitanturok

@leloykun
Copy link
Contributor Author

leloykun commented May 8, 2024

now a duplicate of #875

@leloykun leloykun closed this May 8, 2024
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.

1 participant