multi agent llm
1.0.0
LLMベースのマルチエージェントリポジトリへようこそ!このリポジトリは、さまざまなタスクのマルチエージェントアーキテクチャを使用して、大規模な言語モデル(LLM)を活用するための最先端の技術と方法の無駄のない実装を提供します。これには、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
}
| 方法 | 説明 |
|---|---|
| アイオット | 思考の自律的な反復(AIOT)は、最終的に破棄される代替の探索的思考を生成することなく、会話の進化する状態に基づいて、その推論パスを動的に適応させます。簡単な例 |
| giot | ガイド付き思考(GIOT)は、LLMが事前に定義された数のステップの反復を継続し、推論パスの徹底的な調査を確保するように強制します。簡単な例 |
このリポジトリには、思考の論文反復の結果も含まれています。関連する実験セットアップ、データセット、および結果を見つけることができます。フォルダーには、さまざまなタスクの結果が含まれています。これらのフォルダーを自由に調査して、実験を再現したり、AIOTとGIOTのフレームワークが実際にどのように機能するかをより深く理解してください。