init
This commit is contained in:
parent
497d707a7c
commit
f443f1737a
|
@ -0,0 +1,2 @@
|
|||
env.txt
|
||||
.env
|
|
@ -11,6 +11,16 @@
|
|||
110760672B960D58004E8F2B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110760662B960D58004E8F2B /* ContentView.swift */; };
|
||||
110760692B960D59004E8F2B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 110760682B960D59004E8F2B /* Assets.xcassets */; };
|
||||
1107606C2B960D59004E8F2B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1107606B2B960D59004E8F2B /* Preview Assets.xcassets */; };
|
||||
110760752B961315004E8F2B /* ResponseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110760742B961315004E8F2B /* ResponseModel.swift */; };
|
||||
110760782B96134A004E8F2B /* ContentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110760772B96134A004E8F2B /* ContentViewModel.swift */; };
|
||||
1107607B2B96137B004E8F2B /* APIService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1107607A2B96137B004E8F2B /* APIService.swift */; };
|
||||
1107607E2B9613AD004E8F2B /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1107607D2B9613AD004E8F2B /* Constants.swift */; };
|
||||
110760802B9613B8004E8F2B /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1107607F2B9613B8004E8F2B /* Extensions.swift */; };
|
||||
110760852B9613EC004E8F2B /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110760842B9613EC004E8F2B /* ErrorView.swift */; };
|
||||
110760872B961448004E8F2B /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110760862B961448004E8F2B /* LoadingView.swift */; };
|
||||
112D8BBD2B97671400F18798 /* LangChain in Frameworks */ = {isa = PBXBuildFile; productRef = 112D8BBC2B97671400F18798 /* LangChain */; };
|
||||
112D8BBF2B97681B00F18798 /* env.txt in Resources */ = {isa = PBXBuildFile; fileRef = 112D8BBE2B97681B00F18798 /* env.txt */; };
|
||||
11FA40B72B976B78001A1443 /* ModelInferenceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11FA40B62B976B78001A1443 /* ModelInferenceService.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
|
@ -19,6 +29,16 @@
|
|||
110760662B960D58004E8F2B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
110760682B960D59004E8F2B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
1107606B2B960D59004E8F2B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
110760742B961315004E8F2B /* ResponseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResponseModel.swift; sourceTree = "<group>"; };
|
||||
110760772B96134A004E8F2B /* ContentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentViewModel.swift; sourceTree = "<group>"; };
|
||||
1107607A2B96137B004E8F2B /* APIService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIService.swift; sourceTree = "<group>"; };
|
||||
1107607D2B9613AD004E8F2B /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
|
||||
1107607F2B9613B8004E8F2B /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
|
||||
110760842B9613EC004E8F2B /* ErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorView.swift; sourceTree = "<group>"; };
|
||||
110760862B961448004E8F2B /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
|
||||
110760882B962035004E8F2B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
112D8BBE2B97681B00F18798 /* env.txt */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; lineEnding = 0; name = env.txt; path = untitled/env.txt; sourceTree = SOURCE_ROOT; };
|
||||
11FA40B62B976B78001A1443 /* ModelInferenceService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelInferenceService.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -26,6 +46,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
112D8BBD2B97671400F18798 /* LangChain in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -51,10 +72,17 @@
|
|||
110760632B960D58004E8F2B /* untitled */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
110760882B962035004E8F2B /* Info.plist */,
|
||||
110760812B9613C3004E8F2B /* Components */,
|
||||
1107607C2B96139B004E8F2B /* Helpers */,
|
||||
110760792B96136C004E8F2B /* Services */,
|
||||
110760762B961338004E8F2B /* ViewModels */,
|
||||
110760732B9612F7004E8F2B /* Models */,
|
||||
110760722B96128E004E8F2B /* Views */,
|
||||
110760642B960D58004E8F2B /* untitledApp.swift */,
|
||||
110760662B960D58004E8F2B /* ContentView.swift */,
|
||||
110760682B960D59004E8F2B /* Assets.xcassets */,
|
||||
1107606A2B960D59004E8F2B /* Preview Content */,
|
||||
112D8BBE2B97681B00F18798 /* env.txt */,
|
||||
);
|
||||
path = untitled;
|
||||
sourceTree = "<group>";
|
||||
|
@ -67,6 +95,57 @@
|
|||
path = "Preview Content";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
110760722B96128E004E8F2B /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
110760662B960D58004E8F2B /* ContentView.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
110760732B9612F7004E8F2B /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
110760742B961315004E8F2B /* ResponseModel.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
110760762B961338004E8F2B /* ViewModels */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
110760772B96134A004E8F2B /* ContentViewModel.swift */,
|
||||
);
|
||||
path = ViewModels;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
110760792B96136C004E8F2B /* Services */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1107607A2B96137B004E8F2B /* APIService.swift */,
|
||||
11FA40B62B976B78001A1443 /* ModelInferenceService.swift */,
|
||||
);
|
||||
path = Services;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1107607C2B96139B004E8F2B /* Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1107607D2B9613AD004E8F2B /* Constants.swift */,
|
||||
1107607F2B9613B8004E8F2B /* Extensions.swift */,
|
||||
);
|
||||
path = Helpers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
110760812B9613C3004E8F2B /* Components */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
110760842B9613EC004E8F2B /* ErrorView.swift */,
|
||||
110760862B961448004E8F2B /* LoadingView.swift */,
|
||||
);
|
||||
path = Components;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
|
@ -83,6 +162,9 @@
|
|||
dependencies = (
|
||||
);
|
||||
name = untitled;
|
||||
packageProductDependencies = (
|
||||
112D8BBC2B97671400F18798 /* LangChain */,
|
||||
);
|
||||
productName = untitled;
|
||||
productReference = 110760612B960D58004E8F2B /* untitled.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
|
@ -111,6 +193,9 @@
|
|||
Base,
|
||||
);
|
||||
mainGroup = 110760582B960D58004E8F2B;
|
||||
packageReferences = (
|
||||
112D8BBB2B97671400F18798 /* XCRemoteSwiftPackageReference "langchain-swift" */,
|
||||
);
|
||||
productRefGroup = 110760622B960D58004E8F2B /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
|
@ -125,6 +210,7 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
112D8BBF2B97681B00F18798 /* env.txt in Resources */,
|
||||
1107606C2B960D59004E8F2B /* Preview Assets.xcassets in Resources */,
|
||||
110760692B960D59004E8F2B /* Assets.xcassets in Resources */,
|
||||
);
|
||||
|
@ -137,8 +223,16 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
110760782B96134A004E8F2B /* ContentViewModel.swift in Sources */,
|
||||
1107607B2B96137B004E8F2B /* APIService.swift in Sources */,
|
||||
110760672B960D58004E8F2B /* ContentView.swift in Sources */,
|
||||
110760752B961315004E8F2B /* ResponseModel.swift in Sources */,
|
||||
110760652B960D58004E8F2B /* untitledApp.swift in Sources */,
|
||||
11FA40B72B976B78001A1443 /* ModelInferenceService.swift in Sources */,
|
||||
1107607E2B9613AD004E8F2B /* Constants.swift in Sources */,
|
||||
110760852B9613EC004E8F2B /* ErrorView.swift in Sources */,
|
||||
110760802B9613B8004E8F2B /* Extensions.swift in Sources */,
|
||||
110760872B961448004E8F2B /* LoadingView.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -274,6 +368,7 @@
|
|||
DEVELOPMENT_ASSET_PATHS = "\"untitled/Preview Content\"";
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = untitled/Info.plist;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
||||
|
@ -302,6 +397,7 @@
|
|||
DEVELOPMENT_ASSET_PATHS = "\"untitled/Preview Content\"";
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = untitled/Info.plist;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
|
||||
|
@ -342,6 +438,25 @@
|
|||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCRemoteSwiftPackageReference section */
|
||||
112D8BBB2B97671400F18798 /* XCRemoteSwiftPackageReference "langchain-swift" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/buhe/langchain-swift";
|
||||
requirement = {
|
||||
kind = upToNextMajorVersion;
|
||||
minimumVersion = 0.48.0;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
112D8BBC2B97671400F18798 /* LangChain */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = 112D8BBB2B97671400F18798 /* XCRemoteSwiftPackageReference "langchain-swift" */;
|
||||
productName = LangChain;
|
||||
};
|
||||
/* End XCSwiftPackageProductDependency section */
|
||||
};
|
||||
rootObject = 110760592B960D58004E8F2B /* Project object */;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,302 @@
|
|||
{
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "async-http-client",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/swift-server/async-http-client.git",
|
||||
"state" : {
|
||||
"revision" : "291438696abdd48d2a83b52465c176efbd94512b",
|
||||
"version" : "1.20.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "feedkit",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/nmdias/FeedKit",
|
||||
"state" : {
|
||||
"revision" : "68493a33d862c33c9a9f67ec729b3b7df1b20ade",
|
||||
"version" : "9.1.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "functions-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/supabase-community/functions-swift",
|
||||
"state" : {
|
||||
"revision" : "d2fac1980cf5b589077b635d4e18249f7939a9db",
|
||||
"version" : "1.1.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "generative-ai-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/google/generative-ai-swift",
|
||||
"state" : {
|
||||
"revision" : "e2cebcd90645a3a94c0c823696e510a176bc384a",
|
||||
"version" : "0.4.8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "get",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/kean/Get",
|
||||
"state" : {
|
||||
"revision" : "12830cc64f31789ae6f4352d2d51d03a25fc3741",
|
||||
"version" : "2.1.6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "getextensions",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/binaryscraping/GetExtensions",
|
||||
"state" : {
|
||||
"revision" : "aa20f38721142eb6592b2c8f11179d32d7d70ae3",
|
||||
"version" : "1.0.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "gotrue-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/supabase-community/gotrue-swift",
|
||||
"state" : {
|
||||
"revision" : "e53731e21569b2e9ce6f58763ad0fbce8e2e7603",
|
||||
"version" : "1.3.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "keychainaccess",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/kishikawakatsumi/KeychainAccess",
|
||||
"state" : {
|
||||
"revision" : "84e546727d66f1adc5439debad16270d0fdd04e7",
|
||||
"version" : "4.2.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "langchain-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/buhe/langchain-swift",
|
||||
"state" : {
|
||||
"revision" : "d2c945cfbb0b1b9bc571dc5121fbaa264bb42bd6",
|
||||
"version" : "0.48.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "openai-kit",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/buhe/openai-kit",
|
||||
"state" : {
|
||||
"revision" : "f0c785d22dd14f71a42ad83cedbbddc02591aadb",
|
||||
"version" : "1.8.5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "postgrest-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/supabase-community/postgrest-swift",
|
||||
"state" : {
|
||||
"revision" : "2afb40a2f91ba881db8f04131e1b5146001813a5",
|
||||
"version" : "1.0.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "realtime-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/supabase-community/realtime-swift.git",
|
||||
"state" : {
|
||||
"revision" : "0b985c687fe963f6bd818ff77a35c27247b98bb4",
|
||||
"version" : "0.0.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "similarity-search-kit",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/buhe/similarity-search-kit",
|
||||
"state" : {
|
||||
"revision" : "39bbd0b5c2662728792ee9be132212e5fd4a49e2",
|
||||
"version" : "0.0.16"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "storage-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/supabase-community/storage-swift.git",
|
||||
"state" : {
|
||||
"revision" : "65cae9e1156711043cbdebb27b4df93cbef46a1b",
|
||||
"version" : "0.1.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "supabase-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/supabase-community/supabase-swift",
|
||||
"state" : {
|
||||
"revision" : "7088b85247c8e56317f0b22b9d60655e8f762fec",
|
||||
"version" : "0.3.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-algorithms",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-algorithms",
|
||||
"state" : {
|
||||
"revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42",
|
||||
"version" : "1.2.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-atomics",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-atomics.git",
|
||||
"state" : {
|
||||
"revision" : "cd142fd2f64be2100422d658e7411e39489da985",
|
||||
"version" : "1.2.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-collections",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-collections.git",
|
||||
"state" : {
|
||||
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
|
||||
"version" : "1.1.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-filestore",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/juyan/swift-filestore",
|
||||
"state" : {
|
||||
"revision" : "61aa52c514e39a70c17ce6421d70807f46282154",
|
||||
"version" : "0.7.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-http-types",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-http-types",
|
||||
"state" : {
|
||||
"revision" : "12358d55a3824bd5fed310b999ea8cf83a9a1a65",
|
||||
"version" : "1.0.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-log",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-log.git",
|
||||
"state" : {
|
||||
"revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5",
|
||||
"version" : "1.5.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-nio",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-nio.git",
|
||||
"state" : {
|
||||
"revision" : "635b2589494c97e48c62514bc8b37ced762e0a62",
|
||||
"version" : "2.63.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-nio-extras",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-nio-extras.git",
|
||||
"state" : {
|
||||
"revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63",
|
||||
"version" : "1.22.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-nio-http2",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-nio-http2.git",
|
||||
"state" : {
|
||||
"revision" : "0904bf0feb5122b7e5c3f15db7df0eabe623dd87",
|
||||
"version" : "1.30.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-nio-ssl",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-nio-ssl.git",
|
||||
"state" : {
|
||||
"revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5",
|
||||
"version" : "2.26.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-nio-transport-services",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-nio-transport-services.git",
|
||||
"state" : {
|
||||
"revision" : "6cbe0ed2b394f21ab0d46b9f0c50c6be964968ce",
|
||||
"version" : "1.20.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-numerics",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-numerics.git",
|
||||
"state" : {
|
||||
"revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
|
||||
"version" : "1.0.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-system",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-system.git",
|
||||
"state" : {
|
||||
"revision" : "025bcb1165deab2e20d4eaba79967ce73013f496",
|
||||
"version" : "1.2.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swiftsoup",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/scinfu/SwiftSoup",
|
||||
"state" : {
|
||||
"revision" : "1d39e56d364cba79ce43b341f9661b534cccb18d",
|
||||
"version" : "2.7.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swiftyjson",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/SwiftyJSON/SwiftyJSON",
|
||||
"state" : {
|
||||
"revision" : "b3dcd7dbd0d488e1a7077cb33b00f2083e382f07",
|
||||
"version" : "5.0.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swiftynotion",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/buhe/SwiftyNotion",
|
||||
"state" : {
|
||||
"revision" : "61af40905bfd5eb8cad454e02095dfbdea0498cb",
|
||||
"version" : "0.1.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swxmlhash",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/drmohundro/SWXMLHash",
|
||||
"state" : {
|
||||
"revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f",
|
||||
"version" : "7.0.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "urlqueryencoder",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/kean/URLQueryEncoder",
|
||||
"state" : {
|
||||
"revision" : "4ce950479707ea109f229d7230ec074a133b15d7",
|
||||
"version" : "0.2.1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 2
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
uuid = "A3DF07B5-1F78-431D-A635-A8D7305CB3FE"
|
||||
type = "1"
|
||||
version = "2.0">
|
||||
<Breakpoints>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "D6B89E59-0298-4F35-AAE0-F89608E3C93E"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "untitled/Services/AiService.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "10"
|
||||
endingLineNumber = "10"
|
||||
landmarkName = "ModelInferenceService"
|
||||
landmarkType = "14">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
|
@ -4,6 +4,48 @@
|
|||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Playground (Playground) 1.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
<key>orderHint</key>
|
||||
<integer>10</integer>
|
||||
</dict>
|
||||
<key>Playground (Playground) 2.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
<key>orderHint</key>
|
||||
<integer>11</integer>
|
||||
</dict>
|
||||
<key>Playground (Playground).xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
<key>orderHint</key>
|
||||
<integer>9</integer>
|
||||
</dict>
|
||||
<key>SWXMLHashPlayground (Playground) 1.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
<key>orderHint</key>
|
||||
<integer>7</integer>
|
||||
</dict>
|
||||
<key>SWXMLHashPlayground (Playground) 2.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
<key>orderHint</key>
|
||||
<integer>8</integer>
|
||||
</dict>
|
||||
<key>SWXMLHashPlayground (Playground).xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
<key>orderHint</key>
|
||||
<integer>6</integer>
|
||||
</dict>
|
||||
<key>untitled.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"platform" : "universal",
|
||||
"reference" : "systemIndigoColor"
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// ErrorView.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ErrorView: View {
|
||||
let errorText: String
|
||||
var body: some View {
|
||||
Text(errorText)
|
||||
.foregroundColor(Color.red)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ErrorView(errorText:"example error")
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// LoadingView.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct LoadingView: View {
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Loading..."/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
LoadingView()
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
//
|
||||
// ContentView.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContentView()
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
//
|
||||
// Constants.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct Constants {
|
||||
static let apiEndpoint = "https://official-joke-api.appspot.com/jokes/programming/random"
|
||||
static let server = "official-joke-api.appspot.com"
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// Extensions.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
extension View {
|
||||
// Example of a custom modifier
|
||||
func customModifier() -> some View {
|
||||
self.padding(10)
|
||||
.background(Color.blue)
|
||||
.foregroundColor(.white)
|
||||
.cornerRadius(5)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// ResponseModel.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct ResponseModel: Codable {
|
||||
let ha_response: String
|
||||
}
|
||||
|
||||
|
||||
struct AiResponseModel: Codable {
|
||||
let result: String
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// APIService.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class APIService: NSObject {
|
||||
lazy var urlSession: URLSession = {
|
||||
let configuration = URLSessionConfiguration.default
|
||||
configuration.urlCache = nil // Disable caching for this session
|
||||
configuration.requestCachePolicy = .reloadIgnoringLocalCacheData // Ignore local cache
|
||||
return URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
|
||||
}()
|
||||
|
||||
func fetchData() async throws -> ResponseModel {
|
||||
let url = URL(string: Constants.apiEndpoint)!
|
||||
let (data, _) = try await urlSession.data(from: url)
|
||||
let responseModel = try JSONDecoder().decode(ResponseModel.self, from: data)
|
||||
return responseModel
|
||||
}
|
||||
}
|
||||
|
||||
extension APIService: URLSessionDelegate {
|
||||
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
|
||||
// WARNING: Using .useCredential without validating the certificate poses a security risk
|
||||
if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust,
|
||||
let serverTrust = challenge.protectionSpace.serverTrust {
|
||||
let credential = URLCredential(trust: serverTrust)
|
||||
completionHandler(.useCredential, credential)
|
||||
} else {
|
||||
completionHandler(.performDefaultHandling, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
//
|
||||
// AiService.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 05/03/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import LangChain
|
||||
|
||||
class TranslationService {
|
||||
let template = """
|
||||
Translate all input to hinglish (hindi in english).
|
||||
|
||||
{history}
|
||||
Human: {human_input}
|
||||
Assistant:
|
||||
"""
|
||||
|
||||
lazy var chatgpt_chain: LLMChain = {
|
||||
LLMChain(
|
||||
llm: OpenAI(),
|
||||
prompt: PromptTemplate(input_variables: ["history", "human_input"], partial_variable: [:], template: template),
|
||||
memory: ConversationBufferWindowMemory()
|
||||
)
|
||||
}()
|
||||
|
||||
func translate(text: String) async throws -> String {
|
||||
let input = text
|
||||
// Assuming `chatgpt_chain.predict` returns a String and might throw an error.
|
||||
guard let response = await chatgpt_chain.predict(args: ["human_input": input]) else { return "Failed" }
|
||||
return response
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// ContentViewModel.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
class ContentViewModel: ObservableObject {
|
||||
@Published var responseString: String?
|
||||
@Published var translatedText: String?
|
||||
@Published var isLoading = false
|
||||
@Published var error: Error?
|
||||
|
||||
private var apiService = APIService()
|
||||
private var translationService = TranslationService()
|
||||
|
||||
func fetchData() async {
|
||||
isLoading = true
|
||||
do {
|
||||
let responseModel = try await apiService.fetchData()
|
||||
responseString = responseModel.ha_response
|
||||
isLoading = false
|
||||
} catch {
|
||||
self.error = error
|
||||
isLoading = false
|
||||
}
|
||||
}
|
||||
|
||||
func updateUIWithTranslation(for text: String) async {
|
||||
isLoading = true // Assuming you want to indicate loading state for translation as well.
|
||||
do {
|
||||
let translatedText = try await translationService.translate(text: text)
|
||||
DispatchQueue.main.async {
|
||||
// No longer needs Task, updates directly in the async context.
|
||||
self.translatedText = translatedText
|
||||
self.isLoading = false
|
||||
}
|
||||
} catch {
|
||||
DispatchQueue.main.async {
|
||||
self.error = error
|
||||
self.isLoading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ContentView.swift
|
||||
// untitled
|
||||
//
|
||||
// Created by Raj Sharma on 04/03/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@StateObject var viewModel = ContentViewModel()
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
if viewModel.isLoading {
|
||||
// Replace with a custom loading view if needed
|
||||
LoadingView()
|
||||
} else if let responseString = viewModel.translatedText {
|
||||
Text(responseString)
|
||||
} else if let error = viewModel.error {
|
||||
// Replace with a custom error view if needed
|
||||
ErrorView(errorText:error.localizedDescription)
|
||||
}
|
||||
}.padding()
|
||||
.onAppear {
|
||||
Task {
|
||||
await viewModel.updateUIWithTranslation(for: "Hello mom")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#Preview {
|
||||
ContentView()
|
||||
}
|
||||
|
Loading…
Reference in New Issue