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

Toolkits/issue949 generate openai tool schema #1070

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Commits on Oct 17, 2024

  1. refactor: update FunctionTool to generate OpenAI tool schema

    This commit refactors the `FunctionTool` class in the `function_tool.py` file. It adds a new method `generate_openai_tool_schema` that uses an optional assistant model to generate the OpenAI tool schema for the specified function. If no assistant model is provided, it defaults to creating a GPT_4O_MINI model. The function's source code is used to generate a docstring and schema, which are validated before returning the final schema. If schema generation or validation fails, the process retries up to two times. This refactor improves the functionality and flexibility of the `FunctionTool` class.
    Zhangzeyu97 committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    c2b8dc8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bde54d8 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2024

  1. Here is the translation:

    "Adjusted the code to comply with PEP 8 line length standards. Added the `use_schema_assistant` parameter in `FunctionTool` to control whether to use LLM to generate the schema, with a default value of `False`."
    Zhangzeyu97 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    6d08771 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    942b6e4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    21df8fa View commit details
    Browse the repository at this point in the history
  4. Fix typo

    Zhangzeyu97 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    fd071d6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c8a3c53 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    802d074 View commit details
    Browse the repository at this point in the history
  7. Apply pre-commit fixes

    Zhangzeyu97 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    a343510 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7fb038f View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2024

  1. Apply suggestions from code review

    Co-authored-by: Guohao Li <[email protected]>
    Zhangzeyu97 and lightaime authored Oct 19, 2024
    Configuration menu
    Copy the full SHA
    387a648 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e8d45a4 View commit details
    Browse the repository at this point in the history
  3. Pre-commit fix

    Zhangzeyu97 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    9413ec6 View commit details
    Browse the repository at this point in the history
  4. Remove unnecessary print

    Zhangzeyu97 committed Oct 19, 2024
    Configuration menu
    Copy the full SHA
    d2616f4 View commit details
    Browse the repository at this point in the history