aurelio-labs / funkagent Goto Github PK
View Code? Open in Web Editor NEWExperimental agent using OpenAI Functions
License: MIT License
Experimental agent using OpenAI Functions
License: MIT License
See merefield/discourse-chatbot#29 & https://meta.discourse.org/t/discourse-chatbot-supporting-chatgpt/256652/364?u=merefield
Your video and work really got me up to speed quickly on this new Open AI function framework so thank you very much James. ๐
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
:
Line 82 in a7305d3
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
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.