turing-machines / mentals-ai Goto Github PK
View Code? Open in Web Editor NEWAgents in Markdown syntax (loops, memory and tools included).
Home Page: https://x.com/mentals_ai
License: MIT License
Agents in Markdown syntax (loops, memory and tools included).
Home Page: https://x.com/mentals_ai
License: MIT License
It will be cleaner for debuging and management if we split this
{ "content": "Let's execute the task step by step.\n\nAvailable functions:\n<available_functions>\n# plato\nPlato debates with Xenophon.\nOutput only json object:\n{ \"name\" : \"plato\", \"input\" : \"Prompt to send to the tool or assistant. This may be instructions or question.\" }\n\n# socrates\nSocrates proofreads Plato and Xenophon.\nOutput only json object:\n{ \"name\" : \"socrates\", \"input\" : \"Prompt to send to the tool or assistant. This may be instructions or question.\" }\n\n# xenophon\nXenophon seeks Plato's wisdom.\nOutput only json object:\n{ \"name\" : \"xenophon\", \"input\" : \"Prompt to send to the tool or assistant. This may be instructions or question.\" }\n\n# print_to_stdout\nPrint message to console or screen.\nOutput only json object:\n\"{ \"name\" : \"print_to_stdout\", \"message\" : \"text for printing as a plain text\" }\"\n\n# run_python_code\nGenerate python code to execute.\n1. Always add to the code the 'print' function to output result of code execution to the console, e.g. outputting variables important for understanding the result.\n2. Handle potential None or unexpected types in the Python code within the JSON.\n3. If there is JSON in a script, ensure that no characters are before the starting {.\n4. In JSON, all strings must be enclosed in double quotes, and any double quotes within those strings must be escaped using a backslash (\").\n5. Ensure any backslashes in JSON string values are correctly escaped. This includes doubling them up (\\\\) or properly forming escape sequences for special characters.\nOutput only json object:\n\"{ \"name\" : \"run_python_code\", \"python_code\" : \"insert python code here\", \"dependencies\" : \"insert dependencies splitted by space\" }\"\n\n# bash_command_execute\nGenerate bash command to execute.\n1. Do not use for Python code execution and dependency installation.\n2. Do not use for printing.\n3. Do strings with escape charactres and use double quotes.\n4. For http requests, if the string has spaces, insert a '+' between words.\nOutput only json object:\n\"{ \"name\" : \"bash_command_execute\", \"bash_cmd\" : \"insert bash command here as a plain text\" }\"\n\n# store_in_short_term_memory\nWrite a value to a short-term memory.\nFor memorized data, you should always choose a relevant keyword.\nThe memory keyword is taken from the instruction text.\nOutput only json object:\n\"{ \"name\" : \"store_in_short_term_memory\", \"keyword\" : \"insert memory keyword here\", \"value\" : \"insert memory value here as a plain text\" }\"\n\n# stop\nStop and output a result.\nCalled if instructed to stop further execution or task completed.\nOutput only json object:\n\"{ \"name\" : \"stop\", \"output\" : \"insert output here\" }\"\n</available_functions>\n\nIf a function call is required, select the appropriate function from \n<available_functions> to call next and append to the response.\nOnly function names from the <available_functions> can be used.\nAlways add field 'name' with choosed function name to JSON object.\n\nEnsure that each special character that needs to be escaped in JSON, \nlike quotes within your string, is properly escaped.\n\nDon't output the text of the instruction itself.\nCall 'stop' function if the instruction completed.\n\nINSTRUCTION TO EXECUTE\n--------------------\nAsk Plato with user question: about ai\n", "role": "system" },
Into this
{ "content": "Let's execute the task step by step.\n\nAvailable functions:\n<available_functions>\n# plato\nPlato debates with Xenophon.\nOutput only json object:\n{ \"name\" : \"plato\", \"input\" : \"Prompt to send to the tool or assistant. This may be instructions or question.\" }\n\n# socrates\nSocrates proofreads Plato and Xenophon.\nOutput only json object:\n{ \"name\" : \"socrates\", \"input\" : \"Prompt to send to the tool or assistant. This may be instructions or question.\" }\n\n# xenophon\nXenophon seeks Plato's wisdom.\nOutput only json object:\n{ \"name\" : \"xenophon\", \"input\" : \"Prompt to send to the tool or assistant. This may be instructions or question.\" }\n\n# print_to_stdout\nPrint message to console or screen.\nOutput only json object:\n\"{ \"name\" : \"print_to_stdout\", \"message\" : \"text for printing as a plain text\" }\"\n\n# run_python_code\nGenerate python code to execute.\n1. Always add to the code the 'print' function to output result of code execution to the console, e.g. outputting variables important for understanding the result.\n2. Handle potential None or unexpected types in the Python code within the JSON.\n3. If there is JSON in a script, ensure that no characters are before the starting {.\n4. In JSON, all strings must be enclosed in double quotes, and any double quotes within those strings must be escaped using a backslash (\").\n5. Ensure any backslashes in JSON string values are correctly escaped. This includes doubling them up (\\\\) or properly forming escape sequences for special characters.\nOutput only json object:\n\"{ \"name\" : \"run_python_code\", \"python_code\" : \"insert python code here\", \"dependencies\" : \"insert dependencies splitted by space\" }\"\n\n# bash_command_execute\nGenerate bash command to execute.\n1. Do not use for Python code execution and dependency installation.\n2. Do not use for printing.\n3. Do strings with escape charactres and use double quotes.\n4. For http requests, if the string has spaces, insert a '+' between words.\nOutput only json object:\n\"{ \"name\" : \"bash_command_execute\", \"bash_cmd\" : \"insert bash command here as a plain text\" }\"\n\n# store_in_short_term_memory\nWrite a value to a short-term memory.\nFor memorized data, you should always choose a relevant keyword.\nThe memory keyword is taken from the instruction text.\nOutput only json object:\n\"{ \"name\" : \"store_in_short_term_memory\", \"keyword\" : \"insert memory keyword here\", \"value\" : \"insert memory value here as a plain text\" }\"\n\n# stop\nStop and output a result.\nCalled if instructed to stop further execution or task completed.\nOutput only json object:\n\"{ \"name\" : \"stop\", \"output\" : \"insert output here\" }\"\n</available_functions>\n\nIf a function call is required, select the appropriate function from \n<available_functions> to call next and append to the response.\nOnly function names from the <available_functions> can be used.\nAlways add field 'name' with choosed function name to JSON object.\n\nEnsure that each special character that needs to be escaped in JSON, \nlike quotes within your string, is properly escaped.\n\nDon't output the text of the instruction itself.\nCall 'stop' function if the instruction completed.\n\nINSTRUCTION TO EXECUTE", "role": "system" }, { "content": "Ask Plato with user question: about ai\n", "role": "system" }
Hit with a rate limit on the first run but showing no activity on openapi usage
`./build/mentals agents/loop.gen -d [23:19:21]
Endpoint: https://api.openai.com/v1
API key: sk-proj-0WShc8****************************ha2iCKHPt9u5Q7
Model: gpt-3.5-turbo
Operating System: Darwin 23.4.0
Python Version: 3.11.4
pip version: pip 24.0 from /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip (python 3.11)
conda not found.
poetry not found.
pipenv not found.
[stack_size] 1
[temp] 0.1
[label] root
[desc] Each call send message: "Iteration #current_number". After 3rd iteration message: Hello world!
[use] send_message
[keep_context] true
Exception in LLM::chat_completion: General exception: liboai::Response::CheckResponse(): Rate limited (E_RATELIMIT:0x03)
Exception in Mentals: General exception: liboai::Response::CheckResponse(): Rate limited (E_RATELIMIT:0x03)
libc++abi: terminating due to uncaught exception of type liboai::exception::OpenAIRateLimited: liboai::Response::CheckResponse(): Rate limited (E_RATELIMIT:0x03)
[1] 49315 abort ./build/mentals agents/loop.gen -d
`
Description:
We are tasked with developing a robust web server and API in C++ to facilitate agent-user chat. This system will leverage pgvector for storing chat messages to take advantage of its vector search capabilities, enhancing the functionality of message retrieval based on content similarity.
Objectives:
Technical Requirements:
Acceptance Criteria:
Description:
We need to develop a responsive and intuitive chat interface for our application that allows users to communicate with agents in real-time. This interface should be built using Vue.js and must be compatible with both desktop and mobile devices.
Objectives:
Technical Requirements:
Acceptance Criteria:
on macos
fixed by specifying brew install paths in the makefile:
BREW_INC_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/include
BREW_LIB_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/lib
Description:
We need to establish a CI/CD pipeline that automates the building, testing, and deployment of our application binaries across multiple platforms (Linux, macOS, Windows). This pipeline should also handle the integration and installation of the pgvector database.
Objectives:
Technical Requirements:
Acceptance Criteria:
I am trying to install it in Ubuntu 22.04 and getting following error on make:
(mentalsai) Ubuntu@0068-kci-prxmx10127:/mentals-ai$ make/mentals-ai$
Using compiler: g++ version
mkdir -p build/./src/
g++ -DLINUX -I./src -I./src/toml++ -I./src/toml++/impl -I./src/treehh -I./src/liboai -I./src/liboai/components -I./src/liboai/include -I./src/liboai/include/components -I./src/liboai/include/core -I./src/liboai/core -I./src/nlohmann -MMD -MP -std=c++20 -Wall -Wextra -Werror -O3 -march=native -c src/code_interpreter.cpp -o build/./src/code_interpreter.cpp.o
src/code_interpreter.cpp: In member function ‘void CodeInterpreter::delete_virtual_environment()’:
src/code_interpreter.cpp:37:11: error: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
37 | system(command.c_str());
| ~~~~~~^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [Makefile:63: build/./src/code_interpreter.cpp.o] Error 1
(mentalsai) Ubuntu@0068-kci-prxmx10127:
libfmt
is required to build this project. This should be added to the README.
I have an agent that executes py code. This requires packages installation. Mentals is capable of installing the packages and running the script. The issue is that each time I run the same agent, a venv setup is starting from scratch.
Sometimes it does well, sometimes it can stuck with errors while trying to install the same packages it did before.
log_2024-04-22_14-17-46.txt
The question answer saved to memory but call improper tool to pass it.
Line 165: question saved to memory, but than next xenophon context is missing the question.
This looks like a really amazing idea. I may have missed it, but looks like it only works with OpenAI. Any chance of using a local endpoint in it from Ollama, etc?
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.