> For the complete documentation index, see [llms.txt](https://ds-organization-11.gitbook.io/maccaw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ds-organization-11.gitbook.io/maccaw/fundamentals/getting-set-up.md).

# Getting set up

<details>

<summary>Step1: <strong>Import the Package</strong></summary>

First, import the necessary classes from the `maccaw` package.

```python
from maccaw import OpenaiLLM, ClaudeLLM, MistralAILLM
from maccaw import BaseTool
```

</details>

<details>

<summary>Step 2: <strong>Initialize the LLM</strong></summary>

Create an instance of one of the supported LLMs by providing your API key and any optional parameters.

```python
openai_llm = OpenaiLLM(api_key="your_openai_api_key")
claude_llm = ClaudeLLM(api_key="your_claude_api_key")
mistral_llm = MistralAILLM(api_key="your_mistral_api_key")
```

</details>

<details>

<summary>Step 3: <strong>Define a Tool</strong></summary>

Create a custom tool by subclassing `BaseTool` and implementing the `_run` method.

```python
class MyTool(BaseTool):
    def _run(self, *args, **kwargs):
        # Implement the logic for your tool here
        return "Tool output"

my_tool = MyTool(name="MyTool", description="A custom tool")
```

</details>

<details>

<summary>Step 4: <strong>Get Completions</strong></summary>

Use the LLM instance to get completions based on the defined tool and messages.

```python
messages = [{"role": "user", "content": "Hello, how are you?"}]
tools = [my_tool]

response = openai_llm.ava_llm_completions(messages=messages, tools=tools)
print(response)
```

</details>
