Selamat datang di repositori multi-agen berbasis LLM! Repositori ini memberikan implementasi lean teknik dan metode canggih untuk memanfaatkan model bahasa besar (LLM) dengan arsitektur multi-agen untuk berbagai tugas. Ini termasuk metode yang dikembangkan oleh Agnostiq Inc. serta metode canggih lainnya. Repositori dirancang untuk menjadi modular dan mudah digunakan, memungkinkan untuk eksperimen cepat dan silakan gunakan dengan hati -hati untuk tujuan produksi.
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
}
| Metode | Keterangan |
|---|---|
| AIOT | Iterasi pemikiran otonom (AIOT) secara dinamis mengadaptasi jalur penalarannya berdasarkan keadaan percakapan yang berkembang tanpa menghasilkan pemikiran eksploratif alternatif yang pada akhirnya dibuang. Contoh cepat |
| Giot | Iterasi pemikiran yang dipandu (GIOT) memaksa LLM untuk melanjutkan iterasi untuk sejumlah langkah yang telah ditentukan sebelumnya, memastikan eksplorasi menyeluruh jalur penalaran. Contoh cepat |
Repositori ini juga berisi hasil untuk iterasi pemikiran kertas. Anda dapat menemukan pengaturan eksperimental yang relevan, set data, dan hasil. Folder berisi hasil dari berbagai tugas. Jangan ragu untuk mengeksplorasi folder ini untuk mereproduksi eksperimen atau untuk mendapatkan pemahaman yang lebih dalam tentang bagaimana kerangka kerja aiot dan giot bekerja dalam praktik.