Metadata-Version: 2.1
Name: localstack-extension-openai
Version: 0.1.0
Summary: LocalStack Extension: OpenAI
Home-page: https://github.com/localstack/localstack-extensions/tree/main/openai
Author: Cristopher Pinzon
Author-email: cristopher.pinzon@localstack.cloud
License: Apache License 2.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown; charset=UTF-8
License-File: LICENSE.txt
Requires-Dist: faker >=8.12.1
Requires-Dist: plux >=1.3
Requires-Dist: rolo >=0.3
Provides-Extra: dev
Requires-Dist: localstack-core >=3.1 ; extra == 'dev'
Requires-Dist: openai <1.0,>=0.10.2 ; extra == 'dev'
Requires-Dist: pytest >=6.2.4 ; extra == 'dev'
Requires-Dist: black ==22.3.0 ; extra == 'dev'
Requires-Dist: isort ==5.10.1 ; extra == 'dev'

# LocalStack OpenAI Extension

![GitHub license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)
![Python version](https://img.shields.io/badge/python-3.11%2B-blue)
[![Build Status](https://travis-ci.com/yourusername/localstack-openai-mock.svg?branch=master)](https://travis-ci.com/yourusername/localstack-openai-mock)

This is a LocalStack extension that allows you to mock the OpenAI API for testing and development purposes. It provides a convenient way to interact with a mock OpenAI service locally using LocalStack.

## Installation

You can install this extension directly using the LocalStack extension manager:

```bash
localstack extensions install localstack-extension-openai
```

## Using

Once installed, you can access the OpenAI Mock API through `localhost:4510/v1`.

### Example

```python

import openai
openai.organization = "org-test"
openai.api_key = "test"
openai.api_base = "http://localhost:4510/v1"

completion = openai.ChatCompletion.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ]
)
print(completion.choices)
```

## Coverage
- [x] Chat completion
- [x] Engines Listing
- [x] Transcribe
- [x] Translate
- [x] Generate Image URL
- [ ] Generate Image Base64
- [ ] Embeddings
- [ ] Fine Tuning
- [ ] Files
- [ ] Moderations



## Authors
**Cristopher Pinzon** cristopher.pinzon@localstack.cloud


## Licensing
* The extension code is licensed under the Apache 2.0 License

### Thank you for using the LocalStack OpenAI Extension!
