{"id":26145868,"url":"https://github.com/compiler-inc/compilerswiftai","last_synced_at":"2025-04-14T03:10:05.766Z","repository":{"id":273952483,"uuid":"912213462","full_name":"Compiler-Inc/CompilerSwiftAI","owner":"Compiler-Inc","description":"Swift Package for Compiler Inc's AI Backend API","archived":false,"fork":false,"pushed_at":"2025-03-24T16:51:20.000Z","size":213,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-14T03:09:34.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Compiler-Inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-04T23:28:46.000Z","updated_at":"2025-03-26T02:17:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"df312941-4925-4aaf-94c9-08dd022b3d4a","html_url":"https://github.com/Compiler-Inc/CompilerSwiftAI","commit_stats":null,"previous_names":["compiler-inc/compilerswiftai"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compiler-Inc%2FCompilerSwiftAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compiler-Inc%2FCompilerSwiftAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compiler-Inc%2FCompilerSwiftAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compiler-Inc%2FCompilerSwiftAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Compiler-Inc","download_url":"https://codeload.github.com/Compiler-Inc/CompilerSwiftAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813795,"owners_count":21165634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-11T04:56:22.458Z","updated_at":"2025-04-14T03:10:05.760Z","avatar_url":"https://github.com/Compiler-Inc.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CompilerSwiftAI\n\nSwift Package for Compiler Inc's AI Backend API\n\n## Getting started\n\nLogin to the [Compiler Developer Dashboard](https://developer.compiler.inc/) and choose \"Create a new app\".  Give it a name and description and you will be given an API key. Save that API key, this is the only time it will be shown to you. \n\nOn the next page you will see an app ID. You will use that in your code and set up functions for use with Compiler inside your own project next.\n\n## Setting up your Swift Project\n\nIn any file you want to interface with this framework, you need to import it:\n\n```import CompilerSwiftAI```\n\nAt some central location, in your code set up a client:\n\n```compiler = CompilerClient(appID: \"\u003cfrom-developer-dashboard-for-your-app\u003e\")```\n\nNext you create an enum for \"CompilerFunction\".  This enum conforms `Sendable` and contains a case for each function you're making available.  for example:\n\n```swift\nenum CompilerFunction: Sendable {\n    case doSomething\n    case doSomethingElse\n    case doSomethingWithParameters(someParameter: String, anotherParameter: Double)\n}\n```\n\nNote that parameters supported are: `String`, `Double`, `Float`, `Int`, `Bool`, `Array` and `Dictionary`.\n\nBut, you'll want to add tradtional Swift-style documentation generating comments as well, because these will be use in a later step to help train the AI to best respond to your users. For instance:\n\n```swift\nenum CompilerFunction {\n    /// Users can invoke this function to make something happen\n    case doSomething\n\n    /// This is a function that does something else\n    case doSomethingElse\n\n    /// This is another function, but this one now needs to contains exactly two parameters\n    /// - Parameters:\n    ///   - someParameter: This string describes the function type\n    ///   - anotherParameter: This is a numeric value, and can only have values between 1 and 30 (for example)\n    case doSomethingWithParameters(someParameter: String, anotherParameter: Double)\n}\n```\n\nBe as descriptive as you can be. It will definitely help.  You can limit strings to certain values, give ranges for numeric values, and provide variations of ways a user might word this function, different nomenclature that might be used for the same function or parameters.\n\nThere are more things that you'll want to add to the CompilerFunction enum, but in the next step the dashboard will generate a template for the code you will add later.\n\n## Completing set up on the Developer Dashboard\n\nOn the same page that you got your AppID you will see you available functions, which will start with only one thing, a \"NoOp\" which is returned when no appropriate functions were found.  Head over to the \"Function Builder\" and open the tab for \"Swift Enum Import\".  In the Swift text area, paste in the complete text of the `CompilerFunctionGenerator` enum:\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompiler-inc%2Fcompilerswiftai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompiler-inc%2Fcompilerswiftai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompiler-inc%2Fcompilerswiftai/lists"}