Skip to content

ENG-2425 #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 87 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
88a4c19
Initial
Archetapp Nov 18, 2024
504d506
Updates to Endpoints & RequestBodies
Archetapp Nov 18, 2024
8d5d0d3
fixes
Archetapp Nov 18, 2024
7f4bbbb
Updated Client
Archetapp Nov 19, 2024
3428d0d
Reorganization
Archetapp Nov 19, 2024
4e41228
m4a
Archetapp Nov 19, 2024
335bcd3
Inital
Archetapp Nov 20, 2024
02bb57a
Initial runthrough
Archetapp Nov 20, 2024
0c8bc02
MIService
Archetapp Nov 20, 2024
665b898
Updates & Tests
Archetapp Nov 20, 2024
8c23259
Updated models and endpoints
Archetapp Nov 20, 2024
445485a
updated client
Archetapp Nov 20, 2024
6cb09e1
Deleting Voice
Archetapp Nov 21, 2024
3240a4c
cleanup
Archetapp Nov 21, 2024
94f67d8
removed tests
Archetapp Nov 21, 2024
c88a31b
initial
Archetapp Nov 21, 2024
f5dc921
Added identifiers
Archetapp Nov 21, 2024
ac86273
Files
Archetapp Nov 21, 2024
54bccbd
HTTPClient
Archetapp Nov 21, 2024
e907dd2
get all voices
Archetapp Nov 21, 2024
338ee59
Model
Archetapp Nov 21, 2024
8337564
text tp speech
Archetapp Nov 21, 2024
39302c2
Text to Speech
Archetapp Nov 21, 2024
626c646
clean voice with url
Archetapp Nov 22, 2024
1b8454b
update
Archetapp Nov 22, 2024
5255ec6
Merge branch 'ENG-1518-PlayHT-Endpoints' of https://github.com/Preter…
vmanot Nov 22, 2024
67a5485
Update package
vmanot Nov 22, 2024
cf8952a
Update package
vmanot Nov 22, 2024
a91c932
NeetsAI + HumeAI
Archetapp Nov 23, 2024
05f6319
update tests
Archetapp Nov 23, 2024
17e66c5
removed unused
Archetapp Nov 23, 2024
229088e
HumeAI Endpoints
Archetapp Nov 25, 2024
5b6787f
HumeAI
Archetapp Nov 25, 2024
73db599
Build succeeds
Archetapp Nov 25, 2024
b850efd
tests start
Archetapp Nov 25, 2024
eb9f69c
Testing
Archetapp Nov 25, 2024
c3976a8
Updated tests
Archetapp Nov 25, 2024
f307ead
Prompts working
Archetapp Nov 26, 2024
34fe804
Updated Tests
Archetapp Nov 26, 2024
aae7e75
Merge pull request #41 from PreternaturalAI/ENG-1517-Rime-Additional-…
Archetapp Nov 26, 2024
dd577da
updated Rime
Archetapp Nov 26, 2024
f6e0f65
WIP
NatashaTheRobot Nov 29, 2024
7e10f24
separated out embedding models, added completion models
NatashaTheRobot Nov 30, 2024
2a121f1
added completions api to togetherai
NatashaTheRobot Nov 30, 2024
9aae12c
added llmrequesthandling
NatashaTheRobot Nov 30, 2024
4d410c0
added text embeddings request handling conformance
NatashaTheRobot Nov 30, 2024
3cf471a
CreateImageEdit
Archetapp Dec 3, 2024
c53ff3d
image edits
Archetapp Dec 3, 2024
a040321
Add xAI
pmanot Dec 10, 2024
ecf11cb
Update package
pmanot Dec 10, 2024
e3d75eb
Merge branch 'main' into ENG-1618-Photo-Editor
Archetapp Dec 10, 2024
e61c99d
removed print statements from debugging
Archetapp Dec 10, 2024
939c487
Update package
vmanot Dec 11, 2024
3d68448
Update package
vmanot Dec 11, 2024
9339454
Update package
vmanot Dec 11, 2024
676ef05
language support for playht
Archetapp Jan 2, 2025
520073a
ElevenLabs+Dubbing
Archetapp Jan 9, 2025
4801fe5
update
Archetapp Jan 9, 2025
3a90366
Initial Push w/ Elements from Voice (Not Working)
Archetapp Jan 10, 2025
7541d4d
Building again
Archetapp Jan 10, 2025
9497758
Working
Archetapp Jan 11, 2025
fc6e272
Fixes
Archetapp Jan 11, 2025
78c6949
Merge branch 'main' of https://github.com/PreternaturalAI/AI into ENG…
vmanot Jan 13, 2025
f4ab306
Merge branch 'main' of https://github.com/PreternaturalAI/AI into ENG…
vmanot Jan 13, 2025
fbc2f10
Update
pmanot Jan 13, 2025
f74b0f5
Move files to LargeLanguageModels. Added conformances to individual s…
Archetapp Jan 14, 2025
114db0b
Moved protocol conformances
Archetapp Jan 15, 2025
f2f807c
Cleanup
pmanot Jan 16, 2025
68d193a
Merge branch 'ENG-1846' of https://github.com/PreternaturalAI/AI into…
pmanot Jan 16, 2025
3aba2ad
Update Gemini (Incomplete)
pmanot Jan 16, 2025
5b3e136
Fix
pmanot Jan 16, 2025
1f99056
Fixed build issue
Archetapp Jan 17, 2025
3fe5468
Update
pmanot Jan 18, 2025
68b739d
Merge branch 'ENG-1846' of https://github.com/PreternaturalAI/AI into…
pmanot Jan 18, 2025
6fac42d
Cleanup
pmanot Jan 19, 2025
96c7895
Fix package.swift
pmanot Jan 20, 2025
e28c30f
Merge branch 'main' of https://github.com/PreternaturalAI/AI into ENG…
vmanot Jan 21, 2025
3ecce1b
Merge branch 'ENG-1618-Photo-Editor' of https://github.com/Preternatu…
vmanot Feb 23, 2025
5d913b5
Merge branch 'ENG-1721' of https://github.com/PreternaturalAI/AI into…
vmanot Feb 23, 2025
f7ea454
Merge branch 'ENG-1846' of https://github.com/PreternaturalAI/AI into…
vmanot Feb 23, 2025
6c47824
Update package
vmanot Feb 23, 2025
39bd596
Merge branch 'PlayHT-Updates' of https://github.com/PreternaturalAI/A…
vmanot Feb 23, 2025
9899f3f
Merge branch 'togetherai' of https://github.com/PreternaturalAI/AI in…
vmanot Feb 23, 2025
1f3425d
Merge branch 'xAI' of https://github.com/PreternaturalAI/AI into ENG-…
vmanot Feb 26, 2025
1f2f381
Update package
vmanot Apr 11, 2025
b18859e
added at least 1 import, cleanup
Archetapp Apr 12, 2025
50c3241
Update package
pmanot Jun 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ let package = Package(
"Anthropic"
]
),
.library(
name: "ElevenLabs",
targets: [
"ElevenLabs"
]
),
.library(
name: "HumeAI",
targets: [
Expand Down Expand Up @@ -92,6 +98,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/vmanot/CorePersistence.git", branch: "main"),
.package(url: "https://github.com/vmanot/Media", branch: "main"),
.package(url: "https://github.com/vmanot/Merge.git", branch: "master"),
.package(url: "https://github.com/vmanot/NetworkKit.git", branch: "master"),
.package(url: "https://github.com/vmanot/Swallow.git", branch: "master"),
Expand All @@ -115,7 +122,7 @@ let package = Package(
"Merge",
"NetworkKit",
"Swallow",
"SwiftUIX",
"SwiftUIX"
],
path: "Sources/LargeLanguageModels",
resources: [
Expand Down Expand Up @@ -191,7 +198,8 @@ let package = Package(
"LargeLanguageModels",
"Merge",
"NetworkKit",
"Swallow"
"Swallow",
"Media"
],
path: "Sources/_Gemini",
swiftSettings: [
Expand Down Expand Up @@ -392,6 +400,7 @@ let package = Package(
"Ollama",
"OpenAI",
"Swallow",
"NeetsAI",
],
path: "Sources/AI",
swiftSettings: [
Expand Down Expand Up @@ -563,6 +572,17 @@ let package = Package(
swiftSettings: [
.enableExperimentalFeature("AccessLevelOnImport")
]
),
.testTarget(
name: "TogetherAITests",
dependencies: [
"AI",
"Swallow"
],
path: "Tests/TogetherAI",
swiftSettings: [
.enableExperimentalFeature("AccessLevelOnImport")
]
)
]
)
Expand Down
44 changes: 44 additions & 0 deletions Sources/AI/AnySpeechSynthesisRequestHandling.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// AnySpeechSynthesisRequestHandling.swift
// AI
//
// Created by Jared Davidson on 1/14/25.
//

import ElevenLabs
import LargeLanguageModels
import NeetsAI

// FIXME: - (@archetapp) Is this the best place to put this file?

public struct AnySpeechSynthesisRequestHandling: Hashable {
private let _hashValue: Int

public let base: any CoreMI._ServiceClientProtocol & SpeechSynthesisRequestHandling

public var displayName: String {
switch base {
case is ElevenLabs.Client:
return "ElevenLabs"
case is NeetsAI.Client:
return "NeetsAI"
default:
fatalError()
}
}

public init(
_ base: any CoreMI._ServiceClientProtocol & SpeechSynthesisRequestHandling
) {
self.base = base
self._hashValue = ObjectIdentifier(base as AnyObject).hashValue
}

public static func == (lhs: AnySpeechSynthesisRequestHandling, rhs: AnySpeechSynthesisRequestHandling) -> Bool {
lhs._hashValue == rhs._hashValue
}

public func hash(into hasher: inout Hasher) {
hasher.combine(_hashValue)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import SwallowMacrosClient

extension CoreMI {
/// A type that handles generative machine learning requests.
Expand All @@ -12,7 +13,10 @@
/// `nil` if unknown.
var _availableModels: [ModelIdentifier]? { get }

func consider<R: CoreMI.Request>(_ request: R) async throws -> CoreMI.RequestConsideration
@__unused_method

Check failure on line 16 in Sources/CoreMI/Intramodular/Foundation/CoreMI.RequestHandling.swift

View workflow job for this annotation

GitHub Actions / Build (Xcode 16.2)

unknown attribute '__unused_method'
func consider<R: CoreMI.Request>(
_ request: R
) async throws -> CoreMI.RequestConsideration

func perform<Request: CoreMI.Request, Result: CoreMI.RequestResult>(
_ request: Request,
Expand All @@ -36,7 +40,7 @@
_ request: Request,
returning resultType: Result.Type
) async throws -> Result {
fatalError()
fatalError(.unimplemented)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,72 +28,9 @@ extension ModelIdentifier {
case _Rime
case _HumeAI
case _NeetsAI
case _xAI

case unknown(String)

public static var apple: Self {
Self._Apple
}

public static var fal: Self {
self._Fal
}

public static var openAI: Self {
Self._OpenAI
}

public static var anthropic: Self {
Self._Anthropic
}

public static var groq: Self {
Self._Groq
}

public static var gemini: Self {
Self._Gemini
}

public static var perplexity: Self {
Self._Perplexity
}

public static var jina: Self {
Self._Jina
}

public static var voyageAI: Self {
Self._VoyageAI
}

public static var cohere: Self {
Self._Cohere
}

public static var elevenLabs: Self {
Self._ElevenLabs
}

public static var togetherAI: Self {
Self._TogetherAI
}

public static var playHT: Self {
Self._PlayHT
}

public static var rime: Self {
Self._Rime
}

public static var humeAI: Self {
self._HumeAI
}

public static var neetsAI: Self {
self._NeetsAI
}
}
}

Expand Down Expand Up @@ -138,6 +75,8 @@ extension ModelIdentifier.Provider: CustomStringConvertible {
return "HumeAI"
case ._NeetsAI:
return "NeetsAI"
case ._xAI:
return "xAI"
case .unknown(let provider):
return provider
}
Expand All @@ -151,6 +90,8 @@ extension ModelIdentifier.Provider: RawRepresentable {
return "anthropic"
case ._Apple:
return "apple"
case ._Cohere:
return "cohere"
case ._Fal:
return "fal"
case ._Mistral:
Expand All @@ -169,8 +110,6 @@ extension ModelIdentifier.Provider: RawRepresentable {
return "jina"
case ._VoyageAI:
return "voyageAI"
case ._Cohere:
return "cohere"
case ._ElevenLabs:
return "elevenlabs"
case ._TogetherAI:
Expand All @@ -183,6 +122,8 @@ extension ModelIdentifier.Provider: RawRepresentable {
return "humeAI"
case ._NeetsAI:
return "neetsAI"
case ._xAI:
return "xAI"
case .unknown(let provider):
return provider
}
Expand All @@ -194,36 +135,38 @@ extension ModelIdentifier.Provider: RawRepresentable {
self = ._Anthropic
case Self._Apple.rawValue:
self = ._Apple
case Self._Cohere.rawValue:
self = ._Cohere
case Self._Fal.rawValue:
self = ._Fal
case Self._Mistral.rawValue:
self = ._Mistral
case Self._ElevenLabs.rawValue:
self = ._ElevenLabs
case Self._Groq.rawValue:
self = ._Groq
case Self._OpenAI.rawValue:
self = ._OpenAI
case Self._Gemini.rawValue:
self = ._Gemini
case Self._Perplexity.rawValue:
self = ._Perplexity
case Self._HumeAI.rawValue:
self = ._HumeAI
case Self._Jina.rawValue:
self = ._Jina
case Self._VoyageAI.rawValue:
self = ._VoyageAI
case Self._Cohere.rawValue:
self = ._Cohere
case Self._ElevenLabs.rawValue:
self = ._ElevenLabs
case Self._TogetherAI.rawValue:
self = ._TogetherAI
case Self._Mistral.rawValue:
self = ._Mistral
case Self._NeetsAI.rawValue:
self = ._NeetsAI
case Self._Perplexity.rawValue:
self = ._Perplexity
case Self._PlayHT.rawValue:
self = ._PlayHT
case Self._Rime.rawValue:
self = ._Rime
case Self._HumeAI.rawValue:
self = ._HumeAI
case Self._NeetsAI.rawValue:
self = ._NeetsAI
case Self._TogetherAI.rawValue:
self = ._TogetherAI
case Self._VoyageAI.rawValue:
self = ._VoyageAI
case Self._xAI.rawValue:
self = ._xAI
default:
self = .unknown(rawValue)
}
Expand All @@ -239,3 +182,71 @@ extension ModelIdentifier.Provider: Codable {
try rawValue.encode(to: encoder)
}
}

// MARK: - Supplementary

extension ModelIdentifier.Provider {
public static var apple: Self {
Self._Apple
}

public static var fal: Self {
self._Fal
}

public static var openAI: Self {
Self._OpenAI
}

public static var anthropic: Self {
Self._Anthropic
}

public static var groq: Self {
Self._Groq
}

public static var gemini: Self {
Self._Gemini
}

public static var perplexity: Self {
Self._Perplexity
}

public static var jina: Self {
Self._Jina
}

public static var voyageAI: Self {
Self._VoyageAI
}

public static var cohere: Self {
Self._Cohere
}

public static var elevenLabs: Self {
Self._ElevenLabs
}

public static var togetherAI: Self {
Self._TogetherAI
}

public static var playHT: Self {
Self._PlayHT
}

public static var rime: Self {
Self._Rime
}

public static var humeAI: Self {
self._HumeAI
}

public static var neetsAI: Self {
self._NeetsAI
}
}
Loading
Loading