8 references to ToMemory
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceEmbeddingGenerator.cs (1)
119
ReadOnlySpan<byte> base64 = binaryData.
ToMemory
().Span;
Microsoft.Extensions.AI.OpenAI (6)
OpenAIModelMapper.ChatCompletion.cs (3)
215
using var toolChoiceJson = JsonDocument.Parse(JsonModelHelpers.Serialize(options.ToolChoice).
ToMemory
());
360
OpenAIChatToolJson openAiChatTool = JsonSerializer.Deserialize(chatTool.FunctionParameters.
ToMemory
().Span, OpenAIJsonContext.Default.OpenAIChatToolJson)!;
542
contentPart.ImageBytes is not null ? new DataContent(contentPart.ImageBytes.
ToMemory
(), contentPart.ImageBytesMediaType) :
OpenAIModelMappers.StreamingChatCompletion.cs (1)
146
if (toolCallUpdate.FunctionArgumentsUpdate is { } update && !update.
ToMemory
().IsEmpty)
OpenAISerializationHelpers.cs (2)
58
await stream.WriteAsync(binaryData.
ToMemory
(), cancellationToken).ConfigureAwait(false);
94
writer.Write(sseItem.Data.
ToMemory
().Span);
System.Memory.Data (1)
System\BinaryDataConverter.cs (1)
26
writer.WriteBase64StringValue(value.
ToMemory
().Span);