update to latest versions

This commit is contained in:
Alex Zenla
2024-11-03 03:51:25 -05:00
parent 2e5a37ea4b
commit 8ee3c4c977
26 changed files with 165 additions and 418 deletions

View File

@ -1,25 +1,10 @@
//
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the protocol buffer compiler.
// Source: tokenizer.proto
//
//
// Copyright 2018, gRPC Authors All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import GRPC
import NIO
import NIOConcurrencyHelpers
@ -65,10 +50,8 @@ extension SdTokenizerServiceClientProtocol {
}
}
#if compiler(>=5.6)
@available(*, deprecated)
extension SdTokenizerServiceClient: @unchecked Sendable {}
#endif // compiler(>=5.6)
@available(*, deprecated, renamed: "SdTokenizerServiceNIOClient")
public final class SdTokenizerServiceClient: SdTokenizerServiceClientProtocol {
@ -124,7 +107,6 @@ public struct SdTokenizerServiceNIOClient: SdTokenizerServiceClientProtocol {
}
}
#if compiler(>=5.6)
///*
/// The tokenizer service, for analyzing tokens for a loaded model.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@ -193,9 +175,7 @@ public struct SdTokenizerServiceAsyncClient: SdTokenizerServiceAsyncClientProtoc
}
}
#endif // compiler(>=5.6)
public protocol SdTokenizerServiceClientInterceptorFactoryProtocol: GRPCSendable {
public protocol SdTokenizerServiceClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'tokenize'.
func makeTokenizeInterceptors() -> [ClientInterceptor<SdTokenizeRequest, SdTokenizeResponse>]
@ -258,20 +238,18 @@ extension SdTokenizerServiceProvider {
}
}
#if compiler(>=5.6)
///*
/// The tokenizer service, for analyzing tokens for a loaded model.
///
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public protocol SdTokenizerServiceAsyncProvider: CallHandlerProvider {
public protocol SdTokenizerServiceAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: SdTokenizerServiceServerInterceptorFactoryProtocol? { get }
///*
/// Analyze the input using a loaded model and return the results.
@Sendable func tokenize(
func tokenize(
request: SdTokenizeRequest,
context: GRPCAsyncServerCallContext
) async throws -> SdTokenizeResponse
@ -302,7 +280,7 @@ extension SdTokenizerServiceAsyncProvider {
requestDeserializer: ProtobufDeserializer<SdTokenizeRequest>(),
responseSerializer: ProtobufSerializer<SdTokenizeResponse>(),
interceptors: self.interceptors?.makeTokenizeInterceptors() ?? [],
wrapping: self.tokenize(request:context:)
wrapping: { try await self.tokenize(request: $0, context: $1) }
)
default:
@ -311,9 +289,7 @@ extension SdTokenizerServiceAsyncProvider {
}
}
#endif // compiler(>=5.6)
public protocol SdTokenizerServiceServerInterceptorFactoryProtocol {
public protocol SdTokenizerServiceServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'tokenize'.
/// Defaults to calling `self.makeInterceptors()`.