Skip to content

Commit

Permalink
✨Add OpenAI API support (#2)
Browse files Browse the repository at this point in the history
For easy access to the OpenAI API via code

Signed-off-by: Evan <[email protected]>
  • Loading branch information
BruceMcRooster authored Oct 27, 2024
2 parents b5432a2 + 892b0c4 commit 1217dff
Show file tree
Hide file tree
Showing 4 changed files with 22,702 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,21 @@ let package = Package(
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "OpenAIAPI",
dependencies: [
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
],
path: "Sources/OpenAIAPI",
plugins: [
.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")
]
),
.target(
name: "Nova",
dependencies: [
"OpenAIAPI",
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
]
Expand Down
2 changes: 2 additions & 0 deletions Sources/OpenAIAPI/OpenAIAPI.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file must exist to make OpenAIAPI be considered a target
// if there aren't `GeneratedSources` yet
9 changes: 9 additions & 0 deletions Sources/OpenAIAPI/openapi-generator-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generate:
- types
- client
accessModifier: package
filter:
tags:
- Audio
- Chat
- Images
Loading

0 comments on commit 1217dff

Please sign in to comment.