
一个实验框架,用于动态创建自我改善剂,以响应任务。
查看演示·报告错误·请求功能
微型剂代表了一种创建自我改善代理的新方法。小型,微服务大小(因此,微型)代理是针对用户分配给助手的任务,对其功能进行评估的,并在成功验证后存储以供将来的重复使用。这使整个聊天会议的学习能够使系统能够独立地推断出执行任务的方法。
该项目利用以下技术:
要启动并运行本地副本,请遵循以下简单步骤。
gpt-4-turbo和text-embedding-ada-002 OpenAI帐户。git clone https://github.com/aymenfurter/microagents.gitpip install -r requirements.txt export OPENAI_KEY= ' your_api_key_here ' export AZURE_OPENAI_API_KEY= ' your_api_key_here '
export AZURE_OPENAI_ENDPOINT= ' https://my_endpoint_name_here.openai.azure.com/ '
# export OPENAI_EMBEDDING='' # optionally set the azure deployment name of your ada embedding (in case the name is not text-embedding-ada-002)
# export OPENAI_MODEL='' # optionally set the azure deployment name of your gpt 4 (in case the name is not gpt-4-1106-preview) export AZURE_OPENAI_ENDPOINT= ' https://my_endpoint_name_here.openai.azure.com/ '
export AZURE_OPENAI_USE_AAD= ' true ' # enables DefaultAzureCredential
# export AZURE_OPENAI_AD_TOKEN='' # optionally specify the AAD token here
# export AZURE_CLIENT_ID='' # optionally specify the client id of the managed identity
# export OPENAI_EMBEDDING='' # optionally set the azure deployment name of your ada embedding (in case the name is not text-embedding-ada-002)
# export OPENAI_MODEL='' # optionally set the azure deployment name of your gpt 4 (in case the name is not gpt-4-1106-preview) 警告
MicroAgent直接执行Python代码,目前不在沙盒中运行。强烈建议将它们运行在孤立的环境中,例如github codespese或docker(readme-docker.md),以限制潜在的损害。请注意与使用OpenAI服务相关的费用。
对于演示运行,执行:
python main.py进行互动聊天体验:
python app.py要删除所有代理,只需删除“ agents.db”文件。

You are an adept weather informant. Fetch the weather forecast by accessing public API data using this Python code snippet:
``python
import requests
import json
def fetch_weather_forecast(location, date):
response = requests.get(f"https://api.met.no/weatherapi/locationforecast/2.0/compact?lat={location[0]}&lon={location[1]}")
weather_data = response.json()
for day_data in weather_data['properties']['timeseries']:
if date in day_data['time']:
print(day_data['data']['instant']['details'])
break
``
# Example usage: fetch_weather_forecast((47.3769, 8.5417), '2024-01-22T12:00:00Z')
Note: Replace the (47.3769, 8.5417) with the actual latitude and longitude of the location and the date string accordingly.
You are a skilled IP-based location retriever. Use Python's requests library to obtain geolocation data from a public IP address. Here is a sample code snippet you may adapt:
``python
import requests
def fetch_location_from_ip(ip_address):
response = requests.get(f'http://ip-api.com/json/{ip_address}')
data = response.json()
return data.get('country'), data.get('city')
``
# Example usage:
# print(fetch_location_from_ip('8.8.8.8'))
Ensure that the code is capable of extracting location information such as country and city from the provided IP address.

这是微型剂的第一个版本,自初始项目出版物以来发生了很多事情。这是关键更新:
拉请求:该项目总共收到了6个拉的请求,突出了社区的兴趣。
两个用户接口:我们现在提供两个用于与代理交互的用户接口:
textual-app.py文件开始。该界面是Bearney74的社区贡献。并行化:微型机构现在支持并行性!创建新代理时,实际上并联三个代理。成功完成其任务的第一个代理人被保留,而其他代理人则被处置。
预验证的代理:我们引入了28种预验证的代理,其中包括用于测试。从与OpenStreetMap互动到提供当前的天气信息,这些代理可以实现各种各样的任务。所有这些试剂均使用微型培训。
验证阶段(“法官”) :已添加了一个新的'法官'阶段,以确保声称自己工作的代理人实际上按预期执行。此附加验证步骤可确保仅在工作代理的目录中包含功能齐全的代理。
持续的代理存储:现在在运行中存储代理,用于此目的的SQLITE。
改进的代理记忆:代理现在只能记住他们以前创建的代理。这种方法增强了代理创建的鲁棒性,因为它避免了执行过程中不必要的深度变化。
这些更新代表了微型制剂的显着增强。我期待着社区的进一步改进和贡献。
贡献是使开源社区成为学习,启发和创造的绝佳场所的原因。您所做的任何贡献都非常感谢。
根据MIT许可分发。有关更多信息,请参见LICENSE 。