Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: Exception when calling GetResponseAsync

オープン 初心者向け
#1,127 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp, huggingface
領域
api

調査の方向性

GetResponseAsync のシリアル化パスから開始し、HuggingFace.ChatRequest に対する SourceGenerationContext の処理を調査します。Issue にある Qwen/Qwen2.5-Coder-32B-Instruct のリクエストを再現し、その後、JsonTypeInfo 例外なしで正常なレスポンスが返ることを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug
Summary

Calling GetResponseAsync throws an exception.

Affected area

Serialization

NuGet package version

4.2

.NET version

10

Endpoint or model

Qwen/Qwen2.5-Coder-32B-Instruct

Minimal reproduction

using var client = new HuggingFaceInferenceClient("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");
IChatClient chatClient = client;

var response = await chatClient.GetResponseAsync(
[new(ChatRole.User, "Say hello in one word.")],
new ChatOptions { ModelId = "Qwen/Qwen2.5-Coder-32B-Instruct", MaxOutputTokens = 32 });

Actual behavior

System.InvalidOperationException: 'JsonTypeInfo metadata for type 'HuggingFace.ChatRequest' was not provided by TypeInfoResolver of type 'HuggingFace.SourceGenerationContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.'

Expected behavior

I get a proper response

Logs or request/response details

Operating system

Windows 11

Additional context

No response

Confirmations
  • I searched existing issues for duplicates.
  • I removed API keys, credentials, and other sensitive data.
主要言語
C#
スター
58
フォーク
9
平均マージ
22分
マージ済み PR(30日)
133

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。