Skip to content

Commit

Permalink
Update package again (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymxu authored Dec 14, 2022
1 parent 5c8d7b6 commit 4c78b93
Show file tree
Hide file tree
Showing 15 changed files with 293 additions and 327 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target 'ios' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

pod 'openaikotlin', :path => '../shared'
pod 'openai-kotlin', :path => '../shared'

target 'iosTests' do
inherit! :search_paths
Expand Down
10 changes: 5 additions & 5 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- openaikotlin (0.0.1)
- openai-kotlin (0.0.1)

DEPENDENCIES:
- openaikotlin (from `../shared`)
- openai-kotlin (from `../shared`)

EXTERNAL SOURCES:
openaikotlin:
openai-kotlin:
:path: "../shared"

SPEC CHECKSUMS:
openaikotlin: d873fcb3f9141d4595b6f9c972cc569a8dce6b08
openai-kotlin: 4b0ac2aec10e8ed5737d6d94b797c3834c7d82c0

PODFILE CHECKSUM: 64290bb500b09d8bb1d6e7169a11beb5183bd77d
PODFILE CHECKSUM: 74035878c52d4bf553fe5a2385732cf95e984d93

COCOAPODS: 1.11.3
28 changes: 28 additions & 0 deletions ios/Pods/Local Podspecs/openai-kotlin.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions ios/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

408 changes: 194 additions & 214 deletions ios/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kotlin {
}
}
js(IR) {
moduleName = "openaikotlin"
moduleName = "openai-kotlin"
compilations["main"].packageJson {
customField("version", project.version)
// customField("hello", mapOf("one" to 1, "two" to 2))
Expand All @@ -46,7 +46,7 @@ kotlin {
)

cocoapods {
name = "openaikotlin"
name = "openai-kotlin"
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
version = project.version.toString()
Expand Down Expand Up @@ -141,7 +141,7 @@ mavenPublishing {
npmPublish {
packages {
named("js") {
packageName.set("openaikotlin")
packageName.set("openai-kotlin")
version.set(project.version.toString())
}
}
Expand Down
39 changes: 39 additions & 0 deletions shared/openai-kotlin.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Pod::Spec.new do |spec|
spec.name = 'openai-kotlin'
spec.version = '0.0.1'
spec.homepage = 'Link to the Shared Module homepage'
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
spec.summary = 'Some description for the Shared Module'
spec.vendored_frameworks = 'build/cocoapods/framework/openaikotlin.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '14.1'


spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':shared',
'PRODUCT_MODULE_NAME' => 'openaikotlin',
}

spec.script_phases = [
{
:name => 'Build openai-kotlin',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
SCRIPT
}
]

end
19 changes: 13 additions & 6 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"kotlin": "^1.7.22",
"openaikotlin": "file:../build/js/packages/openaikotlin",
"openai-kotlin": "file:../build/js/packages/openai-kotlin",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SendIcon from '@mui/icons-material/Send';
import {Settings} from "@mui/icons-material";
import {ChatMessage, ChatWindow} from "./Chat";
import {SettingsDialog} from "./SettingsDialog";
import { OpenAiClient } from 'openaikotlin';
import { Response, Completion, OpenAiClient } from 'openai-kotlin';

function scrollChatToBottom() {
let objDiv = document.getElementById("chat-window");
Expand All @@ -32,7 +32,7 @@ function App(props: { apiKey: string }) {
const [model, setModel] = useState('text-davinci-003');
const [maxTokens, setMaxTokens] = useState<number | undefined>();

const onMessageReceived = (message: openaikotlin.Response<openaikotlin.Completion>) => {
const onMessageReceived = (message: Response<Completion>) => {
if (message.error) {
setError(message.error.message)
} else {
Expand Down

0 comments on commit 4c78b93

Please sign in to comment.