HuggingFaceResponsesLanguageModel
Namespace: Vercel.AI.HuggingFace
public sealed class HuggingFaceResponsesLanguageModel : ILanguageModelHugging Face Responses model. LanguageModel(string) stays on Chat Completions
so existing chat clients keep working. Call ResponsesModel(string) for /responses.
Inheritance: object
Implements: ILanguageModel
Constructors
Section titled “Constructors”HuggingFaceResponsesLanguageModel(HuggingFaceProvider, string, Func<string>?)
Section titled “HuggingFaceResponsesLanguageModel(HuggingFaceProvider, string, Func<string>?)”public HuggingFaceResponsesLanguageModel(HuggingFaceProvider provider, string modelId, Func<string>? generateId = null)Creates a responses model. <code class=“paramref”>generateId</code> names sources and defaults to random ids.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
HuggingFaceProvider | |
modelId |
string | |
generateId |
Func<string> |
Properties
Section titled “Properties”ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id, such as openai.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Always V4.
Value: string
Methods
Section titled “Methods”DoGenerateAsync(LanguageModelCallOptions, CancellationToken)
Section titled “DoGenerateAsync(LanguageModelCallOptions, CancellationToken)”public Task<LanguageModelGenerateResult> DoGenerateAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)Generates a complete result.
Parameters
| Name | Type | Description |
|---|---|---|
options |
LanguageModelCallOptions | |
cancellationToken |
CancellationToken |
Returns: Task<LanguageModelGenerateResult>
DoStreamAsync(LanguageModelCallOptions, CancellationToken)
Section titled “DoStreamAsync(LanguageModelCallOptions, CancellationToken)”public Task<LanguageModelStreamResult> DoStreamAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)Streams partial results. The result carries the stream with the request and response info.
Parameters
| Name | Type | Description |
|---|---|---|
options |
LanguageModelCallOptions | |
cancellationToken |
CancellationToken |
Returns: Task<LanguageModelStreamResult>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product