Metadata-Version: 2.1
Name: aibaba_ai_openai
Version: 0.2.14
Summary: An integration package connecting OpenAI and Aibaba AI
Home-page: https://github.com/aibaba-ai/aibaba-ai
License: MIT
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: aibaba_ai_core (>=0.3.27,<0.4.0)
Requires-Dist: openai (>=1.58.1,<2.0.0)
Requires-Dist: tiktoken (>=0.7,<1)
Project-URL: Repository, https://github.com/aibaba-ai/aibaba-ai
Project-URL: Release Notes, https://github.com/aibaba-ai/aibaba-ai/releases?q=tag%3A%22langchain-openai%3D%3D0%22&expanded=true
Project-URL: Source Code, https://github.com/aibaba-ai/aibaba-ai/tree/master/libs/partners/openai
Description-Content-Type: text/markdown

# langchain-openai

This package contains the Aibaba AI integrations for OpenAI through their `openai` SDK.

## Installation and Setup

- Install the Aibaba AI partner package
```bash
pip install langchain-openai
```
- Get an OpenAI api key and set it as an environment variable (`OPENAI_API_KEY`)


## LLM

See a [usage example](http://https://docs.aibaba.world/integrations/llms/openai).

```python
from langchain_openai import OpenAI
```

If you are using a model hosted on `Azure`, you should use different wrapper for that:
```python
from langchain_openai import AzureOpenAI
```
For a more detailed walkthrough of the `Azure` wrapper, see [here](http://https://docs.aibaba.world/integrations/llms/azure_openai)


## Chat model

See a [usage example](http://https://docs.aibaba.world/integrations/chat/openai).

```python
from langchain_openai import ChatOpenAI
```

If you are using a model hosted on `Azure`, you should use different wrapper for that:
```python
from langchain_openai import AzureChatOpenAI
```
For a more detailed walkthrough of the `Azure` wrapper, see [here](http://https://docs.aibaba.world/integrations/chat/azure_chat_openai)


## Text Embedding Model

See a [usage example](http://https://docs.aibaba.world/integrations/text_embedding/openai)

```python
from langchain_openai import OpenAIEmbeddings
```

If you are using a model hosted on `Azure`, you should use different wrapper for that:
```python
from langchain_openai import AzureOpenAIEmbeddings
```
For a more detailed walkthrough of the `Azure` wrapper, see [here](https://docs.aibaba.world/docs/integrations/text_embedding/azureopenai)
