Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 5.35 KB

README.md

File metadata and controls

86 lines (66 loc) · 5.35 KB

Multi-Agent API Orchestrator using CrewAI

Welcome to the Multi-Agent API Orchestrator

Get started by configuring your model and API integrations. We support both Azure OpenAI and OpenAI services. Please follow the steps below:

Configuration Steps

  • Azure OpenAI: Provide the deployment name, endpoint URL, embedding deployment name, and API key.
  • OpenAI: Simply provide your OpenAI API key to enable model integration.

Natural Language (NL) to API Integration

  • Upload API Specification: Upload a valid API Specification file.
  • API Endpoint: Enter the API endpoint for the integration.
  • API Bearer Token: Provide the bearer token to enable secure API authentication.

Once all details are entered, click Upload to validate your inputs and initiate the orchestration process. Streamline API orchestration with CrewAI—handle complexities effortlessly and focus on results.""",

The framework is segregated into 2 crews as described below

Structure and Components of the Interaction Crew

Tools Used

  1. swagger_directory_lister = list all the files in the '{configuration.swagger_files_directory}' directory

  2. swagger_splitter = splits the swagger file into multiple files, and generates a metadata file

  3. get_human_input = gets the input from the user

  4. summary_generator = passes provided text to an LLM model and returns a detailed summary

  5. generated_directory_lister = recursively lists the generated directory's content

  6. metadata_summary_fetcher = reads the generated/summaries/metadata_summaries file's content

  7. api_caller = makes API calls using the "requests" Python library

  8. FileReadTool = reads a file's content

  9. DirectoryReadTool = recursively lists a directory's content

     1-7 = Custom Tools 
     8,9 = Crew AI inbuilt tools
    

Agents in Action

  1. Swagger Splitter Agent = splits large Swagger JSON files into smaller, manageable files, ensuring efficient processing.
  2. Human Input Agent = gathers required information from the user and relaying it back to the delegating agent.
  3. Input Matcher Agent = identifies the best matching Swagger metadata file for a given task using metadata summaries.
  4. Metadata Summarizer Agent = generates concise, descriptive summaries of API capabilities for all Swagger JSON files.
  5. API Selector Agent = selects the most appropriate API endpoint and method from a metadata file to fulfill a task.
  6. Decision Validator Agent = validates whether the actions of the API Selector Agent will satisfactorily fulfill the
    original query and providing clear feedback with reasoning for its decision.
  7. API Caller Agent = clarifies required and optional parameters for an API call, executing the call, and handling any
    errors or missing information.

Agents



Agents

Tasks and Workflow

Steps to Perform before 'Start Crew':

  1. Choose the OpenAI Provider (Azure OpenAI vs Open AI)
  2. If Azure OpenAI is selected, provide the below details:
    1. Azure OpenAI Deployment
    2. Azure OpenAI Endpoint
    3. Azure OpenAI Embedding
  3. Provide the OpenAI Key
  4. Provide the API Endpoint on which queries to be resolved
  5. Provide the API Bearer Token need to authenticate requests to the API Endpoint
  6. Upload the Swagger file containing APIs for the API Endpoint provided
  7. Click on 'Upload' to submit the above details
  8. Click on the 'Start Crew' button to start the crew execution

Execution Initiated by 'Start Crew':

  1. Initial Human Input Task [Human Input Agent] = Prompts the user for their desired action based on the provided Swagger files, and return their response exactly as stated, without any alterations.
  2. Swagger Splitter Task [Swagger Splitter Agent] = Locates all swagger files in the target directory and split them, unless the 'generated' folder already exists, in which case take no action.
  3. Metadata Summarizer Task [Metadata Summarizer Agent] = Triggers the 'summary_generator' tool to generate summaries for swagger files from the specified folder, unless the metadata summary already exists, in which case take no action.
  4. Task Matching Task [Task Matching Agent] = This is only needed if there are multiple Swagger files uploaded. Identifies and return the optimal Swagger metadata file based on user task context and metadata summary analysis.
  5. Manager Task [API Selector Agent] = Identifies and return the most suitable Swagger file based on the metadata summary and user context.
  6. Decision Validator Task [Decision Validator Agent] = Validates the API Selector Agent's proposed answer against the original query, concluding whether it meets the user's intent and expectations.
  7. API Calling Task [API Caller Agent] = Makes the API call, ensuring all parameters are identified, requested, and the payload is confirmed before execution.
  8. Stop execution. Need to click on 'Restart Crew' to start a new session.