ai-sdk-stream-python 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: ai-sdk-stream-python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python package for AI SDK streaming utilities
|
|
5
|
+
Author: copilot-swe-agent[bot]
|
|
6
|
+
Author-email: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
|
7
|
+
Requires-Dist: fastapi>=0.128.8
|
|
8
|
+
Requires-Dist: pydantic>=2.12.5
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# ai-sdk-stream-python
|
|
13
|
+
|
|
14
|
+
A Python package for AI SDK streaming utilities built with [FastAPI](https://fastapi.tiangolo.com/) and [Pydantic](https://docs.pydantic.dev/).
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install ai-sdk-stream-python
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
To run the server, you'll also need an ASGI server such as [uvicorn](https://www.uvicorn.org/):
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install uvicorn
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from ai_sdk_stream_python import app
|
|
32
|
+
import uvicorn
|
|
33
|
+
|
|
34
|
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or run directly:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
uvicorn ai_sdk_stream_python:app --reload
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Endpoints
|
|
44
|
+
|
|
45
|
+
- `GET /` — Returns package name and version.
|
|
46
|
+
- `GET /messages` — Returns a list of dummy messages.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ai-sdk-stream-python
|
|
2
|
+
|
|
3
|
+
A Python package for AI SDK streaming utilities built with [FastAPI](https://fastapi.tiangolo.com/) and [Pydantic](https://docs.pydantic.dev/).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install ai-sdk-stream-python
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
To run the server, you'll also need an ASGI server such as [uvicorn](https://www.uvicorn.org/):
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install uvicorn
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from ai_sdk_stream_python import app
|
|
21
|
+
import uvicorn
|
|
22
|
+
|
|
23
|
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or run directly:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uvicorn ai_sdk_stream_python:app --reload
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Endpoints
|
|
33
|
+
|
|
34
|
+
- `GET /` — Returns package name and version.
|
|
35
|
+
- `GET /messages` — Returns a list of dummy messages.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "ai-sdk-stream-python"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A Python package for AI SDK streaming utilities"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "copilot-swe-agent[bot]", email = "198982749+Copilot@users.noreply.github.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.9"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"fastapi>=0.128.8",
|
|
12
|
+
"pydantic>=2.12.5",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["uv_build>=0.10.9,<0.11.0"]
|
|
17
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from fastapi import FastAPI
|
|
2
|
+
from pydantic import BaseModel
|
|
3
|
+
|
|
4
|
+
app = FastAPI(title="ai-sdk-stream-python", version="0.1.0")
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Message(BaseModel):
|
|
8
|
+
id: int
|
|
9
|
+
content: str
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
_dummy_messages: list[Message] = [
|
|
13
|
+
Message(id=1, content="Hello from ai-sdk-stream-python!"),
|
|
14
|
+
Message(id=2, content="This is a dummy streaming message."),
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@app.get("/")
|
|
19
|
+
def root() -> dict:
|
|
20
|
+
return {"name": "ai-sdk-stream-python", "version": "0.1.0"}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@app.get("/messages", response_model=list[Message])
|
|
24
|
+
def get_messages() -> list[Message]:
|
|
25
|
+
return _dummy_messages
|
|
File without changes
|