Comments (1)
I think using Function_call
to satisfy with this feature, and I show a brief example about using json
as a output format.
the user should input:
input_info = [
"Determines the answer based on their beliefs, desires, intention",
{
"Belief": "The belief factor.",
"Desire": "The desire factor.",
"Intention": "The intention factor.",
},
]
the first element in the input is the description when should the model struct output and the second dict is the detail about the information the user need in the response.
To fit with the function call
function already in camel
. We should transfer the user input to a function:
def generate_text(Believe, Desire, Intention):
"""
Determines the answer based on their beliefs, desires, intention
Args:
Believe (any): The belief factor.
Desire (any): The desire factor.
Intention (any): The intention factor.
Returns:
Dict[str, Any]: A dictionary containing the model's answer with keys for Believe, Desire, Intention
"""
model_answer = {
"Believe": Believe,
"Desire": Desire,
"Intention": Intention,
}
return model_answer
The reason why it can structure the model output is the return of the function is an output the user want. To achieve this transfomation. I already design a function to transfer from the user input to this type function.
Finally we can generate the OpenAIFunction
class using
func_call = OpenAIFunction(
func=generate_text,
)
So I will test if this way can fit with nowaday's code, and I'm also concern about which part in repo should I put my code in.
Thanks for any comment~
from camel.
Related Issues (20)
- [Roadmap] Improve `model` subpackage
- [Feature Request] Frontend for Agent Interaction
- [Feature Request] Create REST API for Camel Agents
- [Question] what's the difference between camel and chatarena? HOT 2
- [Feature Request] Integrate open source embedding model HOT 2
- [Feature Request] Enhancing the Deductive Reasoning Capabilities of the "Deductive Reasoner Agent" with Mathematical Modeling (Stage 2)
- [Roadmap]GitHub function
- [Roadmap] Camel Discord/Web Application HOT 1
- [Feature Request] Add `dependencies_required` and `api_keys_required`
- [Feature] Add `llama.cpp` local backend model support HOT 1
- [Roadmap] Action and ActionAgent
- [BUG] `get_usage_dict` may not work as expected for open source models
- [Feature Request] Discussion on the implementation of open source model type HOT 1
- [Feature Request] add retrieval function for agent to use
- [BUG] About using role_playing_with_open_source_model.py base on local LLM(fastChat vicuna-7b-v1.5) HOT 2
- [Feature Request] Implementing Structured Output Support in AI Role-Playing Module
- [BUG] AugAssign is not supported in `PythonInterpreter` HOT 1
- [BUG] Multi-agent Compatibility Score of Role Assignment HOT 3
- [BUG] Subtasks Decomposition with Dependencies in Cycle HOT 4
- [BUG] fix duplicate system message
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from camel.