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

[Add] Added function calling support to GeminiClient #2793

Closed
wants to merge 32 commits into from

Conversation

arjun-g
Copy link

@arjun-g arjun-g commented May 25, 2024

Why are these changes needed?

I have added function calling ability to GeminiClient so that we can use autogen tools with Gemini as well.

Related issue number

Completes "Function Calling" roadmap item in #2387

Checks

@arjun-g
Copy link
Author

arjun-g commented May 25, 2024

I am learning python just for the past few days. Kindly give me feedback on what I can improve in this.

@BeibinLi
Copy link
Collaborator

Thanks for your great PR @arjun-g !! There are two tiny stuff missing: test cases and tutorial notebook.
Can you add test cases for the new features? I can help to update the Gemini notebook after the test cases are done.

@arjun-g
Copy link
Author

arjun-g commented May 29, 2024

@BeibinLi added a test case. Let me know if this is suffice

@r4881t
Copy link
Contributor

r4881t commented May 31, 2024

@arjun-g - A notebook example of using this would be great to have.

@arjun-g
Copy link
Author

arjun-g commented Jun 2, 2024

@BeibinLi added a notebook as well.

@BeibinLi
Copy link
Collaborator

BeibinLi commented Jun 3, 2024

Thanks @arjun-g for updating. Take a look at @luxzoli PR #2805 , and we might need to slightly update this PR to be consistent with vertexai package. I will edit the notebook after luxzoli's PR is merged. Then, I will edit this PR and merge it.

@arjun-g
Copy link
Author

arjun-g commented Jun 3, 2024

@BeibinLi got it. I will wait for #2805 to be merged. The function call is a bit different in vertex ai. I will handle that and give the PR.

Copy link

gitguardian bot commented Jun 25, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
11616921 Triggered Generic High Entropy Secret 6563248 notebook/agentchat_agentops.ipynb View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 43.75000% with 72 lines in your changes missing coverage. Please review.

Project coverage is 25.59%. Comparing base (03259b2) to head (6563248).
Report is 123 commits behind head on main.

Files Patch % Lines
autogen/oai/gemini.py 43.75% 56 Missing and 16 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2793      +/-   ##
==========================================
- Coverage   32.45%   25.59%   -6.87%     
==========================================
  Files          93       99       +6     
  Lines       10109    10261     +152     
  Branches     2172     2358     +186     
==========================================
- Hits         3281     2626     -655     
- Misses       6544     7325     +781     
- Partials      284      310      +26     
Flag Coverage Δ
unittest 12.35% <2.34%> (?)
unittests 24.81% <43.75%> (-7.65%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@robraux
Copy link
Contributor

robraux commented Jul 8, 2024

Is there anything else you need here @arjun-g? This is an important component for the gemini client I'd love to make use of in a more official capacity. I'm happy to help wrap up.

@arjun-g
Copy link
Author

arjun-g commented Jul 11, 2024

@robraux I am held up in a work. Will update the PR in couple of days,

@luxzoli
Copy link
Contributor

luxzoli commented Aug 9, 2024

It would be really nice to have this feature 🙂

@MO7YW4NG
Copy link

Looking forward to having this feature 🙂

@luxzoli
Copy link
Contributor

luxzoli commented Aug 27, 2024

@arjun-g I have prepared a pull request to your repo that would resolve the merge conflicts, synchronize updates from the upstream autogen repo, and also add support for tool config with function calling.

Only changes to gemini.py , test_gemini.py , and openai_utils.py need to be reviewed, as the rest is changed due to synchronization with the official autogen repo except for agentchat_gemini.ipynb, where the difference is only automated formatting, which is not visible to the user anyway and thus irrelevant.

I hope this would save you some effort in case you still do not have time to finish this PR 🙂

Link to the PR: arjun-g#1

@ekzhu
Copy link
Collaborator

ekzhu commented Oct 1, 2024

@luxzoli would you like to make a PR with your changes directly to this repo? Unless @arjun-g you would like to continue with this?

@luxzoli
Copy link
Contributor

luxzoli commented Oct 1, 2024

@ekzhu yes, sure. I can make a PR directly to the repo if @arjun-g will not finalize this PR

@ekzhu ekzhu changed the base branch from main to 0.2 October 2, 2024 18:28
@ekzhu
Copy link
Collaborator

ekzhu commented Oct 2, 2024

@arjun-g please let us know this week. Thanks!

@jackgerrits jackgerrits added the 0.2 Issues which are related to the pre 0.4 codebase label Oct 4, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Oct 9, 2024

Closing this as work continue in #3726

@ekzhu ekzhu closed this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which are related to the pre 0.4 codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.