Skip to content

siddharthprakash1/MultiAiAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Usage

The MultiAiAgent project utilizes two different Language Model Models (LLMs) for distinct purposes:

Mistral

Mistral is used for general-purpose querying and document parsing. It is employed to interact with users, answer questions about API documentation, and parse PDF documents into logical chunks. Mistral provides a versatile interface for querying the vector store index and retrieving relevant information.

CodeLLama

CodeLLama, on the other hand, specializes in code generation. It is specifically designed to understand code-related queries and generate code snippets based on user prompts. CodeLLama is responsible for interpreting prompts related to code generation, such as requests to generate Python scripts or fetch data from APIs. It leverages its knowledge of programming languages and coding conventions to produce accurate and relevant code output.

Using these two distinct LLMs allows the MultiAiAgent project to handle a wide range of tasks efficiently. Mistral provides the foundation for general querying and document parsing, while CodeLLama specializes in code-related tasks, enhancing the project's versatility and effectiveness.

MultiAiAgent

MultiAiAgent is a project designed to create a multi-functional AI agent capable of reading and understanding API documentation and generating code based on user prompts. This project utilizes various components including the Llama Index, Ollama models, Pydantic for output parsing, and more.

Table of Contents

Introduction

MultiAiAgent leverages advanced language models to interact with users and generate code based on API documentation and user prompts. The project is designed to facilitate efficient code generation and documentation parsing.

Features

  • Parses PDF documents and creates a vector store index for efficient querying.
  • Uses local embedding models for vector embedding.
  • Utilizes advanced language models (Ollama) for querying and code generation.
  • Supports multiple retries for queries to ensure reliability.
  • Cleans and formats the output using Pydantic and AST.
  • Saves generated code to specified files.

Installation

Prerequisites

  • Python 3.7 or higher
  • Git

Steps

  1. Clone the repository

    git clone https://github.com/siddharthprakash1/MultiAiAgent.git
    cd MultiAiAgent
  2. Create a virtual environment and activate it

    python -m venv venv
    source venv/bin/activate   # On Windows: venv\Scripts\activate
  3. Install the required packages

    pip install -r requirements.txt
  4. Set up environment variables

    Create a .env file in the root directory and add any necessary environment variables.

Usage

Running the Project

  1. Start the program

    python main.py
  2. Interact with the agent

    Enter your prompts when prompted by the program. Type q to quit the interaction.

Example Prompts

  • "What are some of the routes in the API?"
  • "Generate a Python script to fetch data from the API."

Code Structure

  • main.py: Main script to run the project.
  • code_reader.py: Module to read and interpret code.
  • prompts.py: Contains prompt templates used by the agent.
  • data/: Directory containing the PDF documents to be parsed.
  • output/: Directory where the generated code files will be saved.

Project Structure

MultiAiAgent/ ├── data/ │ └── example.pdf ├── output/ │ └── generated_code.py ├── main.py ├── code_reader.py ├── prompts.py ├── requirements.txt └── README.md

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages