Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,75 +75,6 @@ receiver.verify(
)
```

#### Create Chat Completions

```python
from qstash import QStash
from qstash.chat import upstash

client = QStash("<QSTASH_TOKEN>")

res = client.chat.create(
model="meta-llama/Meta-Llama-3-8B-Instruct",
provider=upstash(),
messages=[
{
"role": "user",
"content": "What is the capital of Turkey?",
}
],
)

print(res.choices[0].message.content)
```

#### Create Chat Completions Using Custom Providers

```python
from qstash import QStash
from qstash.chat import openai

client = QStash("<QSTASH_TOKEN>")

res = client.chat.create(
model="gpt-3.5-turbo",
provider=openai("<OPENAI_API_KEY>"),
messages=[
{
"role": "user",
"content": "What is the capital of Turkey?",
}
],
)

print(res.choices[0].message.content)
```

#### Publish a JSON message to LLM

```python
from qstash import QStash
from qstash.chat import upstash

client = QStash("<QSTASH_TOKEN>")

res = client.message.publish_json(
api={"name": "llm", "provider": upstash()},
body={
"model": "meta-llama/Meta-Llama-3-8B-Instruct",
"messages": [
{
"role": "user",
"content": "What is the capital of Turkey?",
}
],
},
callback="https://example-cb.com",
)

print(res.message_id)
```

#### Publish a JSON message to LLM Using Custom Providers

```python
Expand Down
39 changes: 0 additions & 39 deletions examples/chat.py

This file was deleted.

6 changes: 3 additions & 3 deletions examples/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""

from qstash import QStash
from qstash.chat import upstash
from qstash.chat import openai


def main():
Expand All @@ -15,9 +15,9 @@ def main():
)

client.message.publish_json(
api={"name": "llm", "provider": upstash()},
api={"name": "llm", "provider": openai("<OPENAI_API_KEY>")},
body={
"model": "meta-llama/Meta-Llama-3-8B-Instruct",
"model": "gpt-4.1",
"messages": [
{
"role": "user",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "qstash"
version = "2.0.5"
version = "3.0.0"
description = "Python SDK for Upstash QStash"
license = "MIT"
authors = ["Upstash <support@upstash.com>"]
Expand Down
2 changes: 1 addition & 1 deletion qstash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from qstash.client import QStash
from qstash.receiver import Receiver

__version__ = "2.0.5"
__version__ = "3.0.0"
__all__ = ["QStash", "AsyncQStash", "Receiver"]
Loading