Willkommen im LLM-basierten Multi-Agent-Repository! Dieses Repository bietet eine magere Implementierung von hochmodernen Techniken und Methoden zur Nutzung von großsprachigen Modellen (LLMs) mit Multi-Agent-Architekturen für verschiedene Aufgaben. Dies umfasst Methoden, die von Agnostiq Inc. sowie anderen hochmodernen Methoden entwickelt wurden. Das Repository ist so konzipiert, dass er modular und einfach zu bedienen ist. Ermöglicht schnelle Experimente und bitte mit Vorsicht für Produktionszwecke.
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
}
| Verfahren | Beschreibung |
|---|---|
| Aiot | Die autonome Iteration des Denkens (AIOT) passt seine Argumentationspfade dynamisch an, basierend auf dem sich entwickelnden Zustand des Gesprächs, ohne alternative explorative Gedanken zu erzeugen, die letztendlich verworfen werden. Schnelles Beispiel |
| Giot | Die geführte Iteration von Gedanken (GIOT) zwingt die LLM dazu, eine vordefinierte Anzahl von Schritten weiter zu iterieren, um eine gründliche Erforschung von Argumentationspfaden zu gewährleisten. Schnelles Beispiel |
Dieses Repository enthält auch die Ergebnisse für die Papier -Iteration des Denkens. Sie finden die relevanten experimentellen Setups, Datensätze und Ergebnisse. Der Ordner enthält Ergebnisse aus verschiedenen Aufgaben. Fühlen Sie sich frei, diese Ordner zu erkunden, um die Experimente zu reproduzieren oder ein tieferes Verständnis dafür zu erhalten, wie die AIOT- und GIOT -Rahmenbedingungen in der Praxis funktionieren.