Skip to content

Commit 0441838

Browse files
authored
Merge pull request #1 from nathanborror/simplify
Simplify library
2 parents ab0ef8c + b03366f commit 0441838

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1033
-3400
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ DerivedData/
66
.swiftpm/configuration/registries.json
77
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
88
.netrc
9-
.secrets
9+
.secrets
10+
/openai

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 MacPaw Inc.
3+
Copyright (c) 2024 Nathan Borror
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
main:
2+
@swift build
3+
@cp .build/debug/OpenAICmd openai
4+
@chmod +x openai
5+
@echo "Run the program with ./openai"
6+

Package.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ let package = Package(
1313
],
1414
products: [
1515
.library(name: "OpenAI", targets: ["OpenAI"]),
16-
.executable(name: "OpenAICmd", targets: ["OpenAICmd"]),
1716
],
1817
dependencies: [
1918
.package(url: "https://github.com/nathanborror/swift-shared-kit", branch: "main"),
@@ -27,6 +26,5 @@ let package = Package(
2726
"OpenAI",
2827
.product(name: "ArgumentParser", package: "swift-argument-parser"),
2928
]),
30-
.testTarget(name: "OpenAITests", dependencies: ["OpenAI"]),
3129
]
3230
)

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
# Swift OpenAI
1+
# OpenAI Swift Client
22

3-
This is a hard fork of [github.com/MacPaw/OpenAI](https://github.com/MacPaw/OpenAI). Use at your own risk.
3+
A Swift client library for interacting with the
4+
[OpenAI API](https://platform.openai.com/docs/api-reference/introduction).
45

5-
Build command Line:
6+
## Requirements
67

7-
$ swift build
8-
$ ./.build/debug/OpenAICmd chat-completion "hi" --token YOUR_TOKEN --model gpt-4
9-
Hello! How can I assist you today?
8+
- Swift 5.9+
9+
- macOS 14+
10+
- [OpenAI API key](https://platform.openai.com/settings)
11+
12+
## Installation
13+
14+
### Swift Package Manager
15+
16+
Add the following to your `Package.swift` file:
17+
18+
```swift
19+
.package(url: "https://github.com/nathanborror/swift-openai.git", branch: "main")
20+
```

0 commit comments

Comments
 (0)