openagi
0.2.9.8

Openagi는 모든 사람이 인간과 같은 에이전트를 이용할 수있게하여 오픈 에이전트와 결국 모든 사람을위한 AGI를 향한 길을 열어줍니다. 우리는 AI의 변형력을 강력하게 믿으며이 이니셔티브가 많은 실제 문제를 해결하는 데 크게 기여할 것이라고 확신합니다. 현재 Openagi는 개발자에게 자율적 인 인간과 같은 에이전트를 만들기위한 프레임 워크를 제공하도록 설계되었습니다.
불화 커뮤니티에 가입하십시오! # 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]으로 연결하십시오
Openagi는 오픈 소스 프로젝트의 빠르게 진화하는 환경에서 번성합니다. 우리는 혁신적인 기능, 향상된 인프라 또는 정제 된 문서를 통해 다양한 용량에 대한 기여를 진심으로 환영합니다.
기여 과정에 대한 포괄적 인 안내서를 보려면 여기를 클릭하십시오.