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