Code Monkey home page Code Monkey logo

Comments (1)

Fanjia-Yan avatar Fanjia-Yan commented on June 12, 2024

Hey Keith! Thank you very much for trying our Gorilla OpenFunctions model.

We have read your inputs & outputs. Here are some corrections and suggestions to have it output better result:

  1. The messages variable defines the natural language prompt that you come up with. For example, if you're using the get_current_weather function, a prompt like "What's the weather like in SF?" will make the most sense for the model to assemble the function call. Here's an example setup:
messages = [{"role": "user", "content": "What's the weather like in SF?"}]
functions = [
    {
        "name": "get_current_weather",
        "description": "Get the current weather in a given location",
        "parameters": {
            "type": "object",
            "properties": {
                "location": {
                    "type": "string",
                    "description": "The city and state, e.g. San Francisco, CA. State must be included",
                },
                "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
            },
            "required": ["location"],
        },
    }
]
  1. If you are experimenting with normal function calling, you should stick with v0 as it provides more stable experience. V1 is specifically designed for parallel function calling and we are making effort to actively improve that model.
  2. The motivation behind OpenFunctions is making function calls based on function documentation and natural language instruction. As this model is specifically designed for function calling, we don’t know how well it might behave for general purpose chatting :)
  3. In case you are not aware, we have a sample Jupyter notebook https://colab.research.google.com/drive/16M5J2H9F8YQora_W2PDnp120slZH-Mqd#scrollTo=eBd_fso7qFPX where we provided several examples and instructions to follow.
    Again, thank you for using our model and let me know here if you need help!

from gorilla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.