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

Function calling example using OSS models #30

Merged
merged 9 commits into from
Dec 15, 2023
Merged

Conversation

simjak
Copy link
Member

@simjak simjak commented Dec 15, 2023

No description provided.

@simjak simjak self-assigned this Dec 15, 2023
Copy link

PR Analysis

  • 🎯 Main theme: Adding function calling examples using OpenAI and Mistral models in a Jupyter notebook.
  • 📝 PR summary: This PR introduces a Jupyter notebook that demonstrates how to call functions using OpenAI and Mistral models. It also includes examples of generating routing configurations, extracting parameters, and setting up a routing layer. The notebook also demonstrates how to call these functions with different queries.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 4, because the PR includes a significant amount of new code in a Jupyter notebook, which requires a careful review to ensure the code is correct and the explanations are clear.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR is well-structured and the code is clear. However, it would be beneficial to add more comments to explain the purpose of each code block in the notebook. This would make it easier for other developers to understand the code and its purpose. Additionally, it would be helpful to include error handling in the code to manage potential issues that could arise during execution.

  • 🤖 Code feedback:
    relevant filedocs/examples/function_calling.ipynb
    suggestion      Consider adding more comments to explain the purpose of each code block. This will make it easier for other developers to understand the code and its purpose. [medium]
    relevant line"+ \"def llm_openai(prompt: str, model: str = \"gpt-4\") -> str:\n",

    relevant filedocs/examples/function_calling.ipynb
    suggestion      Consider adding error handling to manage potential issues that could arise during execution. This will make the code more robust and easier to debug. [important]
    relevant line"+ \"def llm_openai(prompt: str, model: str = \"gpt-4\") -> str:\n",

    relevant filedocs/examples/function_calling.ipynb
    suggestion      Consider using more descriptive variable names. This will make the code easier to read and understand. [medium]
    relevant line"+ \"def call_function(function: Callable, parameters: dict[str, str]):\n",

    relevant filedocs/examples/function_calling.ipynb
    suggestion      Consider adding type hints to your function definitions. This will make the code easier to understand and debug. [medium]
    relevant line"+ \"def call_function(function: Callable, parameters: dict[str, str]):\n",

How to use

Instructions

To invoke the PR-Agent, add a comment using one of the following commands:
/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.
/add_docs: Generate docstring for new components introduced in the PR.
/generate_labels: Generate labels for the PR based on the PR's contents.
see the tools guide for more details.

To edit any configuration parameter from the configuration.toml, add --config_path=new_value.
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, add a /config comment.

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6a0001d) 100.00% compared to head (cd4d798) 100.00%.
Report is 5 commits behind head on main.

❗ Current head cd4d798 differs from pull request most recent head 573519c. Consider uploading reports for the commit 573519c to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #30   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          344       344           
=========================================
  Hits           344       344           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@simjak simjak merged commit a92f302 into main Dec 15, 2023
3 checks passed
@simjak simjak deleted the simonas/function-calling branch December 15, 2023 09:53
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