
一個實驗框架,用於動態創建自我改善劑,以響應任務。
查看演示·報告錯誤·請求功能
微型劑代表了一種創建自我改善代理的新方法。小型,微服務大小(因此,微型)代理是針對用戶分配給助手的任務,對其功能進行評估的,並在成功驗證後存儲以供將來的重複使用。這使整個聊天會議的學習能夠使系統能夠獨立地推斷出執行任務的方法。
該項目利用以下技術:
要啟動並運行本地副本,請遵循以下簡單步驟。
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 。