Skip to content

Commit

Permalink
Update pollinations-ai.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCurrin authored Jan 7, 2025
1 parent 27299ce commit dc21f0a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cheatsheets/artificial-intelligence/pollinations-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,20 @@ The text endpoint also includes a path for an API that follows the **OpenAI** sp

- `https://text.pollinations.ai/openai`

With `openai`:
With the [openai](https://pypi.org/project/openai/) package:

```python
from openai import OpenAI

client = OpenAI(base_url="https://text.pollinations.ai/openai", api_key="dummy")
```

With LangChain's [ChatOpenAI](https://python.langchain.com/docs/integrations/chat/openai/):
With the [langchain-openai](https://pypi.org/project/langchain-openai/) package and [ChatOpenAI](https://python.langchain.com/docs/integrations/chat/openai/) class:

```python
from langchain_openai import ChatOpenAI

client = ChatOpenAI(ChatOpenAI(
base_url="https://text.pollinations.ai/openai",
openai_api_key="dummy",
)
client = ChatOpenAI(base_url="https://text.pollinations.ai/openai", openai_api_key="dummy")
```

### Image endpoint
Expand Down

0 comments on commit dc21f0a

Please sign in to comment.