Step by Step

Step-by-Step Guide

1. Setup Environment Variables

The Maccaw agent needs an API key and base URL to communicate with OpenAI's LLMs. Create a .env file in your project directory and add the following keys:

BASE_URL=https://api.openai.com/v1/engines [Optional]
API_KEY=your_openai_api_key
MODEL_NAME=gpt-3.5-turbo

Replace your_openai_api_key with your actual OpenAI API key.

Install Required Libraries

Run the following commands to install the necessary libraries:

pip install maccaw pydantic winshell pywin32 python-dotenv
  • maccaw: Allows integration with LLM-based agents.

  • pydantic: For data validation.

  • winshell and pywin32: For working with the Windows recycle bin.

Step 3: Import Required Libraries

Next, we'll import the required libraries. The winshell module allows us to interact with the recycle bin, and we’ll use pydantic to define the structure of the tool's inputs.

import os
import winshell
from pydantic import BaseModel, Field
from typing import Optional, Type
from maccaw.maccaw import BaseTool
from win32com.client import Dispatch

Last updated