multi agent llm
1.0.0
مرحبًا بك في مستودع Multi-Agent المستند إلى LLM! يوفر هذا المستودع تنفيذًا هزيلًا لتقنيات وطرق متطورة للاستفادة من نماذج اللغة الكبيرة (LLMS) مع بنيات متعددة الوكلاء لمختلف المهام. ويشمل ذلك الطرق التي طورتها Agnostiq Inc. وكذلك الأساليب الحديثة الأخرى. تم تصميم المستودع ليكون وحدات وسهلة الاستخدام ، مما يسمح بالتجربة السريعة ويرجى استخدامه بحذر لأغراض الإنتاج.
pip install -U multi-agent-llm import os ; os . environ [ 'OPENAI_API_KEY' ] = "your_openai_api_key"
from multi_agent_llm import OpenAILLM , AIOT
from pydantic import BaseModel , Field
llm = OpenAILLM ( model_name = "gpt-4o-mini" ) # Currently we only have wrapper for OpenAI, but it can be easily extended to other LLMs
# Define the answer schema
class QueryAnswer ( BaseModel ):
explanation : str = Field ( description = "Explanation of the answer" )
answer : str = Field ( description = "Final Answer" )
# Initialize AIOT with the LLM and run a sample query
aiot = AIOT ( llm = llm , iterations = 2 , answer_schema = QueryAnswer )
result = aiot . run ( "How many R's are there in the word 'Strawberry'?" )
print ( result ) Discussion Result
-----------------
How many R's are there in the word 'Strawberry'?
Thought Process:
Iteration 1:
IDA: Let's break down the word 'Strawberry'. First, count the letters in the word and then specifically look for the letter 'R'. Remember to pay attention to uppercase and lowercase letters, but focus primarily on the letter 'R'. How many instances of 'R' do you find?
LLMA:
{
explanation: The word 'Strawberry' contains a total of three instances of the letter 'R'. This includes two uppercase 'R's and one lowercase 'r'. Therefore, when counting the letter 'R' in both forms, we find that there are 3 occurrences in total.
answer: 3
}
Final Answer:
{
explanation: The word 'Strawberry' contains a total of three instances of the letter 'R'. This includes two uppercase 'R's and one lowercase 'r'. Therefore, when counting the letter 'R' in both forms, we find that there are 3 occurrences in total.
answer: 3
}
| طريقة | وصف |
|---|---|
| أيوت | يتكيف التكرار المستقل للتفكير (AIOIT) ديناميكيًا مسارات التفكير بناءً على الحالة المتطورة للمحادثة دون توليد أفكار استكشافية بديلة يتم التخلص منها في النهاية. مثال سريع |
| جيوت | يجبر التكرار الموجه للفكر (GIOT) LLM على الاستمرار في التكرار لعدد محدد مسبقًا من الخطوات ، مما يضمن استكشافًا شاملاً لمسارات التفكير. مثال سريع |
يحتوي هذا المستودع أيضًا على نتائج التكرار الورقي للفكر. يمكنك العثور على الإعدادات التجريبية ذات الصلة ومجموعات البيانات والنتائج. يحتوي المجلد على نتائج من مهام مختلفة. لا تتردد في استكشاف هذه المجلدات لإعادة إنتاج التجارب أو للحصول على فهم أعمق لكيفية عمل أطر AIOIT و GIOT في الممارسة العملية.