Skip to content

examples: Update streaming ChatGPT example for Swift 6.1 #759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Swift",
"image": "swift:6.0",
"image": "swift:6.1",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/git:1": {}
Expand All @@ -16,7 +16,7 @@
"lldb.library": "/usr/lib/liblldb.so"
},
"extensions": [
"sswg.swift-lang",
"swiftlang.swift-vscode",
"42Crunch.vscode-openapi"
]
}
Expand Down
11 changes: 0 additions & 11 deletions Examples/streaming-chatgpt-proxy/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"editor.lightbulb.enabled": "off",
"explorer.decorations.badges": false,
"explorer.decorations.colors": false,
"files.exclude": {
"**/.build": true,
"**/.build-linux": true,
Expand All @@ -14,18 +11,10 @@
"*.swiftdeps": true,
"*.swiftdeps~": true,
},
"outline.problems.colors": false,
"outline.problems.badges": false,
"lldb.library": "/usr/lib/liblldb.so",
"lldb.launch.expressions": "native",
"swift.diagnosticsStyle": "default",
"swift.disableAutoResolve": true,
"swift.sourcekit-lsp.backgroundIndexing": "off",
"swift.sourcekit-lsp.disable": true,
"swift.buildPath": ".build-linux",
"workbench.colorCustomizations": {
"editorError.foreground": "#00000000",
"editorWarning.foreground": "#00000000",
},
"workbench.startupEditor": "none"
}
10 changes: 6 additions & 4 deletions Examples/streaming-chatgpt-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ An example project using [Swift OpenAPI Generator](https://github.com/apple/swif
A tailored API server, backed by ChatGPT, and client CLI, with end-to-end
streaming.

This package is the reference sources for the demo presented at [FOSDEM 2025:
_Live coding a streaming ChatGPT proxy with Swift OpenAPI—from
scratch!_][fosdem25-swift-openapi]
This package is the reference sources for the talk, _Live coding a streaming ChatGPT proxy with Swift OpenAPI—from scratch!, presented at:

- [FOSDEM 2025][fosdem25-swift-openapi]
- [try! Swift 2025][tryswift25]

> Join us as we build a ChatGPT client, from scratch, using Swift OpenAPI Generator. We’ll take advantage of Swift OpenAPI’s pluggable HTTP transports to reuse the same generated client to make upstream calls from a Linux server, providing end-to-end streaming, backed by async sequences, without buffering upstream responses.
>
Expand All @@ -24,7 +25,7 @@ scratch!_][fosdem25-swift-openapi]
> * Efficiently transform responses from SSE to JSON Lines, maintaining end-to-end streaming.

The example provides an API for a fictitious _ChantGPT_ service, which produces
creative chants to sing at basketball games. 🙌 🏀 🙌
creative chants to sing at sports games. 🙌 🏟️ 🙌

## Usage

Expand Down Expand Up @@ -70,4 +71,5 @@ Containers][dev-containers].
If you have the Dev Containers extension installed, use the `Dev Containers: Reopen in Container` command to switch to build and run for Linux.

[fosdem25-swift-openapi]: https://fosdem.org/2025/schedule/event/fosdem-2025-5230-live-coding-a-streaming-chatgpt-proxy-with-swift-openapi-from-scratch-/
[tryswift25]: https://tryswift.jp/en/
[dev-containers]: https://code.visualstudio.com/docs/devcontainers/containers