
Openagi ตั้งเป้าหมายที่จะทำให้ทุกคนสามารถเข้าถึงตัวแทนที่เหมือนมนุษย์ได้ เราเชื่อมั่นในพลังการเปลี่ยนแปลงของ 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 ที่ openagi.aiplanet.com
สำหรับข้อสงสัย/ข้อเสนอแนะ/การสนับสนุนเชื่อมต่อเราได้ที่ [email protected]
Openagi เติบโตในภูมิทัศน์ที่พัฒนาอย่างรวดเร็วของโครงการโอเพนซอร์ซ เรายินดีต้อนรับการมีส่วนร่วมอย่างสุดซึ้งในความสามารถต่าง ๆ ไม่ว่าจะผ่านคุณสมบัติที่เป็นนวัตกรรมโครงสร้างพื้นฐานที่ได้รับการปรับปรุงหรือเอกสารที่ได้รับการปรับปรุง
สำหรับคู่มือที่ครอบคลุมเกี่ยวกับกระบวนการบริจาคโปรดคลิกที่นี่