Giter Site home page Giter Site logo

funkagent's People

Contributors

jamescalam avatar merefield avatar tazarov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

funkagent's Issues

ISSUE: funkagent should adopt formal function response message format

I've noticed an issue with funkagent, it's not using the formal function response message format described in the documentation

https://platform.openai.com/docs/guides/gpt/function-calling

The format should be

      messages.append(
          {
              "role": "function",
              "name": function_name,
              "content": function_response,
          }
      )  # extend conversation with function response

But instead it's using the assistant role and missing the function name:

res_msg = {'role': 'assistant', 'content': (f"The answer is {result}.")}

This is not critical, it appears, but it's a tidy up and may facilitate dropping the "answer is" text for a tiny token win. And we don't know if this will become more important in the future.

An equivalent change is illustrated below on my Ruby on Rails agent:

merefield/discourse-chatbot@6b89b62

I've PR'd on #9

role function in function response

Bug:
shouldn't https://github.com/aurelio-labs/funkagent/blob/main/funkagent/agents.py#L82 be role 'function' not 'assistant'? This will help the model from not calling the function again with the same query. You expressed this worry on the video and probably this is why it happens.

To add usefulness to functions:
I think you can redact function responses in future questions as only the query/response is really important for context. If the AI needs to know the same thing again it can ask again. (this will limit context window and cut down costs).

It's useful to know if a query is "related" to another query (in the same user context) and if so add previous history otherwise start with 0 history. A semantic lookup on the query/response can be done here at a high threshold. At worsed case you may need to pass the previous response in a secondary check to ensure user is not inferring to the previous response in an ambiguous way.

License?

Hi, thanks for the video and for this cool approach to spinning up an agent! Is the code here open sourced or MIT licensed? I'm considering using it for a project but wasn't sure whether the license is compatible

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.