Skip to content

Commit 1e75aee

Browse files
examples: Update streaming ChatGPT example for Swift 6.1 (#759)
### Motivation The streaming ChatGPT example we have uses Swift 6.0 and the Swift VS Code extension from the SSWG. Since then, Swift 6.1 has been released, which contains fixes for indexing and editor functionality for code generated by Swift package plugins. The VS Code plugin has also been moved to the Swift project. ### Modifications - Update the example dev container to Swift 6.1. - Update the example dev container to use `swiftlang.swift-vscode`. - Clean up redundant workarounds in VS Code settings. - Link to try! Swift in addition to FOSDEM for folks looking for reference sources from conference talk. ### Result Example represents what was most recently presented. ### Test Plan CI will ensure the package has not regressed.
1 parent 9218c26 commit 1e75aee

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

Diff for: Examples/streaming-chatgpt-proxy/.devcontainer/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Swift",
3-
"image": "swift:6.0",
3+
"image": "swift:6.1",
44
"features": {
55
"ghcr.io/devcontainers/features/common-utils:2": {},
66
"ghcr.io/devcontainers/features/git:1": {}
@@ -16,7 +16,7 @@
1616
"lldb.library": "/usr/lib/liblldb.so"
1717
},
1818
"extensions": [
19-
"sswg.swift-lang",
19+
"swiftlang.swift-vscode",
2020
"42Crunch.vscode-openapi"
2121
]
2222
}
-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"editor.lightbulb.enabled": "off",
3-
"explorer.decorations.badges": false,
4-
"explorer.decorations.colors": false,
52
"files.exclude": {
63
"**/.build": true,
74
"**/.build-linux": true,
@@ -14,18 +11,10 @@
1411
"*.swiftdeps": true,
1512
"*.swiftdeps~": true,
1613
},
17-
"outline.problems.colors": false,
18-
"outline.problems.badges": false,
1914
"lldb.library": "/usr/lib/liblldb.so",
2015
"lldb.launch.expressions": "native",
2116
"swift.diagnosticsStyle": "default",
2217
"swift.disableAutoResolve": true,
23-
"swift.sourcekit-lsp.backgroundIndexing": "off",
24-
"swift.sourcekit-lsp.disable": true,
2518
"swift.buildPath": ".build-linux",
26-
"workbench.colorCustomizations": {
27-
"editorError.foreground": "#00000000",
28-
"editorWarning.foreground": "#00000000",
29-
},
3019
"workbench.startupEditor": "none"
3120
}

Diff for: Examples/streaming-chatgpt-proxy/README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ An example project using [Swift OpenAPI Generator](https://github.com/apple/swif
99
A tailored API server, backed by ChatGPT, and client CLI, with end-to-end
1010
streaming.
1111

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

1617
> 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.
1718
>
@@ -24,7 +25,7 @@ scratch!_][fosdem25-swift-openapi]
2425
> * Efficiently transform responses from SSE to JSON Lines, maintaining end-to-end streaming.
2526
2627
The example provides an API for a fictitious _ChantGPT_ service, which produces
27-
creative chants to sing at basketball games. 🙌 🏀 🙌
28+
creative chants to sing at sports games. 🙌 🏟️ 🙌
2829

2930
## Usage
3031

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

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

0 commit comments

Comments
 (0)