anthropics / anthropics/ClaudeForFoundationModels

Using ClaudeForFoundationModels in projects that support earlier OS versions

未关闭
#12 3 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Swift
星标
292
派生
30
平均合并
23 分钟
30 天内合并 PR
4

描述

### Request

I wanted to integrate this package into our existing project that supports macOS 15, iOS 18, and visionOS 2 and I ran into problems because your `Package.swift` specifies that the package can only be used on Apple’s OS 27 versions. If I’m not missing something, it should be possible to lower that version number and annotate all your (public?) symbols with `@available(anyAppleOS 27.0, *)`, right? If you did that, many more projects could use your code.

Are there any plans on doing this? Do you accept pull requests with this kind of change?
Or am I missing something and there’s a good reason not to do this?

### Steps to reproduce

These are the steps to reproduce this issue:
```
> mkdir ClaudeTest
> cd ClaudeTest
> swift package init
> xed Package.swift
```
Then, add the ClaudeForFoundationModels dependency to the package and target and specify the platforms supported by the package to e.g. include macOS 15. The complete `Package.swift` file should then look like this:

Complete Package.swift

```
// swift-tools-version: 6.4
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ClaudeTest",
platforms: [.macOS(.v15), .iOS(.v18), .visionOS(.v2)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "ClaudeTest",
targets: ["ClaudeTest"]
),
],
dependencies: [
.package(url: "https://github.com/anthropics/ClaudeForFoundationModels", branch: "main")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "ClaudeTest",
dependencies: [
"ClaudeForFoundationModels"
],
swiftSettings: [
.enableUpcomingFeature("ApproachableConcurrency"),
],
),
.testTarget(
name: "ClaudeTestTests",
dependencies: ["ClaudeTest"],
swiftSettings: [
.enableUpcomingFeature("ApproachableConcurrency"),
],
),
]
)
```

Then:
```
> swift build
Fetching https://github.com/anthropics/ClaudeForFoundationModels from cache
Fetched https://github.com/anthropics/ClaudeForFoundationModels from cache (0.48s)
Creating working copy for https://github.com/anthropics/ClaudeForFoundationModels
Working copy of https://github.com/anthropics/ClaudeForFoundationModels resolved at main (f7b70b6)
Building for debugging...
error: The package product 'ClaudeForFoundationModels-product' requires minimum platform version 27.0 for the macOS platform, but this target supports 15.0
error: The package product 'ClaudeForFoundationModels-product' requires minimum platform version 27.0 for the macOS platform, but this target supports 15.0

error: Build failed
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。