{"id":22021907,"url":"https://github.com/functioncalling/functioncalling-macpaw-openai","last_synced_at":"2025-06-28T02:03:31.539Z","repository":{"id":259460879,"uuid":"858257977","full_name":"FunctionCalling/FunctionCalling-MacPaw-OpenAI","owner":"FunctionCalling","description":"Easy to use your Swift native functions for function calling with MacPaw/OpenAI.","archived":false,"fork":false,"pushed_at":"2025-06-11T04:36:30.000Z","size":34,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T03:46:13.257Z","etag":null,"topics":["functioncalling","macpaw","openai","openai-api","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FunctionCalling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-09-16T15:29:21.000Z","updated_at":"2025-06-11T04:36:04.000Z","dependencies_parsed_at":"2024-10-25T17:26:55.769Z","dependency_job_id":"e3fe36df-1ec8-4f34-80bc-05e26654b1b3","html_url":"https://github.com/FunctionCalling/FunctionCalling-MacPaw-OpenAI","commit_stats":null,"previous_names":["functioncalling/functioncalling-macpaw-openai"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/FunctionCalling/FunctionCalling-MacPaw-OpenAI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunctionCalling%2FFunctionCalling-MacPaw-OpenAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunctionCalling%2FFunctionCalling-MacPaw-OpenAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunctionCalling%2FFunctionCalling-MacPaw-OpenAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunctionCalling%2FFunctionCalling-MacPaw-OpenAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FunctionCalling","download_url":"https://codeload.github.com/FunctionCalling/FunctionCalling-MacPaw-OpenAI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunctionCalling%2FFunctionCalling-MacPaw-OpenAI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262362049,"owners_count":23299119,"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":["functioncalling","macpaw","openai","openai-api","swift"],"created_at":"2024-11-30T06:16:16.501Z","updated_at":"2025-06-28T02:03:31.533Z","avatar_url":"https://github.com/FunctionCalling.png","language":"Swift","readme":"# FunctionCalling-MacPaw-OpenAI\n\nThis library simplifies the integration of the [FunctionCalling](https://github.com/fumito-ito/FunctionCalling) macro into [MacPaw/OpenAI](https://github.com/MacPaw/OpenAI). By using this library, you can directly generate `Tool` objects from Swift native functions, which can then be specified as FunctionCalling when invoking OpenAI.\n\n## Usage\n\n```swift\n\nimport FunctionCalling\nimport FunctionCalling_MacPaw_OpenAI\nimport OpenAI\n\n// MARK: Declare the container and functions for the tools to be called from FunctionCalling.\n\n@FunctionCalling(service: .chatGPT)\nstruct MyFunctionTools {\n    @CallableFunction\n    /// Get the current stock price for a given ticker symbol\n    ///\n    /// - Parameter: The stock ticker symbol, e.g. GOOG for Google Inc.\n    func getStockPrice(ticker: String) async throws -\u003e String {\n        // code to return stock price of passed ticker\n    }\n}\n\n// MARK: You can directly pass the tools generated from objects to the model in ChatQuery.\nlet query = ChatQuery(\n    model: .gpt3_5Turbo,\n    messages: [.init(role: .user, content: \"who are you\")],\n    tools: FunctionContainer().macPawOpenAITools\n)\nlet result = try await openAI.chats(query: query)\n```\n\n## Installation\n\n### Swift Package Manager\n\n```\nlet package = Package(\n    name: \"MyPackage\",\n    products: [...],\n    targets: [\n        .target(\n            \"YouAppModule\",\n            dependencies: [\n                .product(name: \"FunctionCalling-MacPaw-OpenAI\", package: \"FunctionCalling-MacPaw-OpenAI\")\n            ]\n        )\n    ],\n    dependencies: [\n        .package(url: \"https://github.com/FunctionCalling/FunctionCalling-MacPaw-OpenAI\", from: \"0.1.0\")\n    ]\n)\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\nThe MIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctioncalling%2Ffunctioncalling-macpaw-openai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunctioncalling%2Ffunctioncalling-macpaw-openai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctioncalling%2Ffunctioncalling-macpaw-openai/lists"}