An open API service indexing awesome lists of open source software.

https://github.com/dpo007/ollamachatwithtools

A PowerShell script that integrates Ollama's chat capabilities with context-aware tools. It demonstrates how to maintain chat context and call PowerShell functions as tools. 🤖
https://github.com/dpo007/ollamachatwithtools

chatbot llm ollama ollama-api powershell

Last synced: 4 months ago
JSON representation

A PowerShell script that integrates Ollama's chat capabilities with context-aware tools. It demonstrates how to maintain chat context and call PowerShell functions as tools. 🤖

Awesome Lists containing this project

README

        

# ChatWithTools.ps1 🛠️🤖

Welcome to **OllamaChatWithTools**, a PowerShell script designed to showcase the integration of **Ollama's chat capabilities** with tools and context persistence. This repository serves as a test/example for leveraging Ollama/LLMs in the PowerShell scripting environments. ✨

## Key Features 🌐

### 🎮 Context-Aware Conversations
- Maintains the context of your chat, making interactions consistent and logical.
- Remembers previous responses and queries for a seamless experience.
- Enables coherent multi-step interactions.

### 🔧 PowerShell Script Functions as Tools
- Demonstrates leveraging PowerShell script functions as Tools to generate more accurate, "live" answers by pulling data from APIs and the system.

### 🔍 Test and Experiment
- Perfect for exploring LLM capabilities from PowerShell.
- Learn how context and tools can elevate interactive scripting.
- Provides a solid foundation for building your own chat integrations.

## Prerequisites 🔐

To get started, ensure you have the following:
1. **PowerShell 5.1+** installed on your system.
2. A running instance of [Ollama](https://ollama.com/).
3. Basic familiarity with PowerShell scripting.

## Running the Script 🚀

When running the script, you can use the following parameters:

### 📋 Available Parameters

- **`LMMKeepAlive`**: Specifies the keep-alive duration for the LLM model. Default is `'5m'`.
- **`LMMModel`**: Defines the LLM model to use. Default is `'mistral-nemo'`.
- **`LLMApiEndpointURL`**: The API endpoint URL for the LLM. Default is `'http://localhost:11434/api'`.
- **`MorePirate`**: A switch to make the LLM respond in a pirate-like manner.

### 💻 Example Usage

1. Open PowerShell.
2. Run the script without any parameters (uses default values):
```powershell
.\ChatWithTools.ps1
```
3. Run the script with the desired parameters:
```powershell
.\ChatWithTools.ps1 -LMMKeepAlive '5m' -LMMModel 'mistral-nemo' -LLMApiEndpointURL 'http://localhost:11434/api' -MorePirate
```

## Why This Script? 🎩

**OllamaChatWithTools** provides a practical way to:
- Explore how tools can be utilized in LLM chat sessions.
- Understand how chat context can enhance interactive scripting.
- Experiment with blending automation and AI capabilities.

## Contributions 📚

Have ideas to make this script even better? Contributions are welcome! Fork the repo, make your changes, and open a pull request.

---

🔧 Happy scripting! 🌟