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

Not an issue, just wanted to share some findings regarding function calling :) #17

Open
draganjovanovich opened this issue Apr 14, 2024 · 0 comments

Comments

@draganjovanovich
Copy link

draganjovanovich commented Apr 14, 2024

First of all, Nous hermes 2 pro is a beast of an 7B reasoning model.

I've been experimenting with the Hermes 2 Pro, and I've noticed some maybe interesting behavior.

According to the repository instructions, I initially used the model with <tool> <tools> and <tool_call>, etc with converted functions to openai etc...

However, I discovered that it performs significantly better (at least for my use cases) when directly interacting with raw API calls (no tools defined) and no langchain.

Specifically, I set up each API endpoint in an OpenAPI specification and provided it in user part of the prompt, allowing the model to dynamically choose any endpoint it deems useful, while disregarding those it doesn't need.

It was able to use tools when needed, and avoid tools altogether when not needed even in long chat sessions.

Example "Tools" used: generate_image, search_vector_store, expand_image, etc...

Sample that Hermes 2 generated:

{
  "name": "generate_image",
  "body": {
    "prompt": "A beautiful rainy night in a small village, with a raincoat wearing person holding an umbrella. In the style of Leonid Afremov."
  },
  "path_params": {},
  "query_params": {}
}
Screenshot 2024-04-14 at 17 07 23 Screenshot 2024-04-14 at 17 07 14

Constant parts of api call (POST, GET, token, etc..) are excluded on purpose, as they are piped trough code.
So model is instructed to generate only "moving parts".

So what was better for me using it in this way, is that it much more often chooses right API Call, and avoiding it when is not needed for user query.

I am writing this as someone might find it useful...

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

No branches or pull requests

1 participant