openagi
0.2.9.8

Openagiは、人間のようなエージェントをすべての人がアクセスできるようにすることを目指しており、それにより、オープンエージェントへの道を開いて、最終的にはすべての人のためにAgiを舗装することを目指しています。私たちはAIの変革力を強く信じており、このイニシアチブが多くの現実の問題の解決に大きく貢献すると確信しています。現在、Openagiは、開発者に自律的な人間のようなエージェントを作成するためのフレームワークを提供するように設計されています。
私たちのDiscordコミュニティに参加してください! # For Mac and Linux users
python3 -m venv venv
source venv/bin/activate
# For Windows users
python -m venv venv
venv/scripts/activatepip install openagiまたは
git clone https://github.com/aiplanethub/openagi.git
pip install -e .
労働者は、マルチエージェントアーキテクチャを作成するために使用されます。
この例に従って、旅程をSFに計画するのに役立つ旅行プランナーエージェントを作成します。
from openagi . agent import Admin
from openagi . planner . task_decomposer import TaskPlanner
from openagi . actions . tools . ddg_search import DuckDuckGoSearch
from openagi . llms . openai import OpenAIModel
from openagi . worker import Worker
plan = TaskPlanner ( human_intervene = False )
action = DuckDuckGoSearch
import os
os . environ [ 'OPENAI_API_KEY' ] = "sk-xxxx"
config = OpenAIModel . load_from_env_config ()
llm = OpenAIModel ( config = config )
trip_plan = Worker (
role = "Trip Planner" ,
instructions = """
User loves calm places, suggest the best itinerary accordingly.
""" ,
actions = [ action ],
max_iterations = 10 )
admin = Admin (
llm = llm ,
actions = [ action ],
planner = plan ,
)
admin . assign_workers ([ trip_plan ])
res = admin . run (
query = "Give me total 3 Days Trip to San francisco Bay area" ,
description = "You are a knowledgeable local guide with extensive information about the city, it's attractions and customs" ,
)
print ( res )労働者なしで自律的に実行できるスポーツエージェントを構築しましょう。
from openagi . planner . task_decomposer import TaskPlanner
from openagi . actions . tools . tavilyqasearch import TavilyWebSearchQA
from openagi . agent import Admin
from openagi . llms . gemini import GeminiModel
import os
os . environ [ 'TAVILY_API_KEY' ] = "<replace with Tavily key>"
os . environ [ 'GOOGLE_API_KEY' ] = "<replace with Gemini key>"
os . environ [ 'Gemini_MODEL' ] = "gemini-1.5-flash"
os . environ [ 'Gemini_TEMP' ] = "0.1"
gemini_config = GeminiModel . load_from_env_config ()
llm = GeminiModel ( config = gemini_config )
# define the planner
plan = TaskPlanner ( autonomous = True , human_intervene = True )
admin = Admin (
actions = [ TavilyWebSearchQA ],
planner = plan ,
llm = llm ,
)
res = admin . run (
query = "I need cricket updates from India vs Sri lanka 2024 ODI match in Sri Lanka" ,
description = f"give me the results of India vs Sri Lanka ODI and respective Man of the Match" ,
)
print ( res )LTMを使用すると、Openagiエージェントは今です:
import os
from openagi . agent import Admin
from openagi . llms . openai import OpenAIModel
from openagi . memory import Memory
from openagi . planner . task_decomposer import TaskPlanner
from openagi . worker import Worker
from openagi . actions . tools . ddg_search import DuckDuckGoSearch
memory = Memory ( long_term = True )
os . environ [ 'OPENAI_API_KEY' ] = "-"
config = OpenAIModel . load_from_env_config ()
llm = OpenAIModel ( config = config )
web_searcher = Worker (
role = "Web Researcher" ,
instructions = """
You are tasked with conducting web searches using DuckDuckGo.
Find the most relevant and accurate information based on the user's query.
""" ,
actions = [ DuckDuckGoSearch ],
)
admin = Admin (
actions = [ DuckDuckGoSearch ],
planner = TaskPlanner ( human_intervene = False ),
memory = memory ,
llm = llm ,
)
admin . assign_workers ([ web_searcher ])
query = input ( "Enter your search query: " )
description = f"Find accurate and relevant information for the query: { query } "
res = admin . run ( query = query , description = description )
print ( res )その他のクエリについては、openagi.aiplanet.comでOpenagiのドキュメントをご覧ください
任意のクエリ/提案/サポートについては、[email protected]で私たちを連絡してください
Operagiは、オープンソースプロジェクトの急速に進化する風景で繁栄しています。革新的な機能、強化されたインフラストラクチャ、洗練されたドキュメントなど、さまざまな能力への貢献を心から歓迎します。
貢献プロセスに関する包括的なガイドについては、ここをクリックしてください。