semvec/pypi-packages huggingface dataset:
gpt-assistant-lib 0.3.1
Python library for your AI assistant, powered by GPT.
License: MIT
Requires Python: >=3.11,<4.0

# GPT-Assistant Library

The GPT-Assistant Library is a Python-based toolkit for building intelligent personal assistants powered by OpenAI's GPT
models. This library simplifies the integration of conversational AI into your applications, making it easier than ever
to create chatbots, virtual assistants, and more.

## Key Features

- Seamless integration with GPT-3 and GPT-4 models.
- Easily manage conversations and user interactions.
- Support multiuser chat history support
- Customizable and extensible to suit your specific needs.
- Developer-friendly API for smooth integration into your projects.

## Installation

```shell
pip install gpt-assistant-lib
```

## Configuration

To set up the assistant, you need an API key and to create a system prompt.

### Obtain API key

Go to Openai [website](https://platform.openai.com/account/api-keys)

### System prompt

It will define your assistant behaviour.
More info you can find
in [documentation](https://platform.openai.com/docs/guides/gpt-best-practices/tactic-ask-the-model-to-adopt-a-persona)

### History

The library maintains a conversation history that the assistant relies on to understand and maintain context during
interactions. This conversation history is included in every request sent to OpenAI. A larger history size allows
the assistant to remember more context, enhancing its ability to engage in meaningful conversations.
However, it's important to note that larger conversation histories can result in increased API call costs.

## Usage

```python
import gpt_assistant_lib

openai_api_key = "your_openai_api_key"
initial_prompt = "You are a helpful assistant."
max_history_size = 5
history_lifetime = 600  # 10 minutes
assistant = gpt_assistant_lib.build_assistant(openai_api_key, initial_prompt, max_history_size, history_lifetime)
while True:
    user_input = input("You: ")
    assistant_response = assistant.exchange("any", user_input)
    print(f"Assistant: {assistant_response}")
```

## Development

> Run with enabled virtual environment

Autoformat source code

```shell
task format
```

Run all linters

```shell
task lint
```

Run unit tests

```shell
task test
```

Run all linters and unit tests

```shell
task all
```

## License

This project is licensed under the MIT License
trellis_dag 0.1.6
DAG-based LLM execution framework.
License: MIT
Requires Python: >=3.9,<4.0

# Trellis
## Intro
**Trellis is an open-source framework for programmatically
orchestrating LLM workflows as Directed Acyclic Graphs (DAGs) in Python.** We've intentionally designed it to give 
developers as much control as possible, and we've written documentation to make it incredibly easy to 
get started. Start building with our [docs](https://interlocklabsinc.mintlify.app/documentation/introduction).

## Structure
Trellis is composed of only three abstractions: `Node`, `DAG`, and `LLM`.
- Node: the atomic unit of Trellis. Nodes are chained together to form a DAG. 
  `Node` is an abstract class with only *one* method required to implement.
- DAG: a directed acyclic graph of `Node`s. It is the primary abstraction for orchestrating LLM workflows. When you 
  add edges between `Node`s, you can specify a transformation function to reuse `Node`s and connect any two `Node`s.
  Trellis verifies the data flowing between `Nodes` in a `DAG` to ensure the flow of data is validated. 
- LLM: a wrapper around a large language model with simple catches for common OpenAI errors. Currently, the only provider
  that Trellis supports is OpenAI.

## Environment Variables
- If you're going to use the LLM class, set:
    - `OPENAI_API_KEY=YOUR_OPENAI_KEY`
- If you don't want us to send telemetry data (in the `Node._init_()`, `LLM.execute()` (including prompts and responses from OpenAI) and `DAG.execute()` methods, info about nodes you create or dags you run), to an external server (currently (PostHog)[https://posthog.com/]) for analysis, set:
    - `DISABLE_TELEMETRY=1`
- If you want to reduce the amount of information the logger returns, set:
    - [for everything] `LOG_LEVEL=DEBUG`
    - [for status updates] `LOG_LEVEL=INFO`
    - [for only warnings] `LOG_LEVEL=WARNING`
    - [for errors which stop runtime] `LOG_LEVEL=ERROR`
    - [for only critical errors] `LOG_LEVEL=CRITICAL`

## Install
You can install Trellis with any of the following methods:

### Pip
```
pip install trellis-dag
```

### Poetry
```
poetry add trellis-dag
```

### Conda
```
conda install trellis-dag
```