?這個最新的 BabyAGI 是一個用于自構建自主代理的實驗框架
核心是一個新的函數框架 (functionz),用于存儲、管理和執行數據庫中的函數。它提供了一個基于圖形的結構,用于跟蹤導入、依賴函數和身份驗證密鑰,并具有自動加載和全面的日志記錄功能。此外,它還附帶一個用于管理函數、運行更新和查看日志的控制面板。
官網:https://github.com/yoheinakajima/babyagi
安裝
pip install babyagi
啟動?
import babyagiif __name__ == "__main__":app = babyagi.create_app('/dashboard')app.run(host='0.0.0.0', port=8080)
登錄
http://127.0.0.1:8080/
其實是這里
http://192.168.0.98:8080/dashboard/
頁面顯示:
這個展示頁面有什么用呢?
basic使用
import babyagi# Register a simple function
@babyagi.register_function()
def world():return "world"# Register a function that depends on 'world'
@babyagi.register_function(dependencies=["world"])
def hello_world():x = world()return f"Hello {x}!"# Execute the function
print(babyagi.hello_world()) # Output: Hello world!if __name__ == "__main__":app = babyagi.create_app('/dashboard')app.run(host='0.0.0.0', port=8080)
比如在192.168.0.16瀏覽:
http://192.168.0.16:8080/dashboard/
?可以看到新寫的world和hello_world這兩個函數。
Function Metadata函數元數據
Functions can be registered with metadata to enhance their capabilities and manage their relationships. Here's a more comprehensive example of function metadata, showing logical usage of all fields:
函數可以注冊到元數據中,以增強其功能并管理它們之間的關系。下面是一個更全面的函數元數據示例,顯示了所有字段的邏輯用法:
import babyagi@babyagi.register_function(imports=["math"],dependencies=["circle_area"],key_dependencies=["openai_api_key"],metadata={"description": "Calculates the volume of a cylinder using the circle_area function."} ) def cylinder_volume(radius, height):import matharea = circle_area(radius)return area * height
Available Metadata Fields:
imports
: List of external libraries the function depends on.dependencies
: List of other functions this function depends on.key_dependencies
: List of secret keys required by the function.metadata["description"]
: A description of what the function does.
總結
這個軟件不錯,但是后面沒有更新了,證明后勁不足!
所以只是關注,未花費精力去使用。