Skip to content

Commit

Permalink
Cleanup and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed Feb 11, 2025
1 parent 54dbf6e commit 53dc37a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SPDX-License-Identifier: Apache-2.0
-->
<tracerFactory name="OpenAiChat">
<match assemblyName="OpenAI" className="OpenAI.Chat.ChatClient">
<exactMethodMatcher methodName="CompleteChat" parameters="System.Collections.Generic.IEnumerable`1[[OpenAI.Chat.ChatMessage]], OpenAI.Chat.ChatCompletionOptions, System.Threading.CancellationToken" />
<exactMethodMatcher methodName="CompleteChat" parameters="System.Collections.Generic.IEnumerable`1[OpenAI.Chat.ChatMessage],OpenAI.Chat.ChatCompletionOptions,System.Threading.CancellationToken" />
<exactMethodMatcher methodName="CompleteChatAsync" parameters="System.Collections.Generic.IEnumerable`1[OpenAI.Chat.ChatMessage], OpenAI.Chat.ChatCompletionOptions, System.Threading.CancellationToken" />
</match>
</tracerFactory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ private static Dictionary<string, string> GetResponseHeaders(dynamic clientResul
var headersDictionary = new Dictionary<string, string>();
foreach (var header in headers)
{
var headerKey = header.Key;
string headerKey = header.Key;
var headerValue = header.Value as string;
headersDictionary.Add(headerKey, headerValue);
headersDictionary.Add(headerKey.ToLower(), headerValue);
}

return headersDictionary;
Expand Down Expand Up @@ -296,8 +296,8 @@ private void HandleError(ISegment segment, string model, Task responseTask, IAge
agent,
segment,
requestId,
0,
0,
null,
null,
model,
null,
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static string TryGetOpenAiOrganization(this IDictionary<string, string> h

public static string TryGetRequestId(this Dictionary<string, string> headers)
{
return headers.TryGetValue("X-Request-ID", out var requestId) ? requestId : null;
return headers.TryGetValue("x-request-id", out var requestId) ? requestId : null;
}
}
}

0 comments on commit 53dc37a

Please sign in to comment.