Граф коммитов

1362 Коммитов

Автор SHA1 Сообщение Дата
Stephen Toub 2aa1535ded Explicitly reference System.Memory.Data in OpenAI/AzureAIInference projects (#5576)
To ensure a recent version is used.
2024-11-05 10:24:55 -08:00
Stephen Toub 500abd72bf Add changelogs for M.E.AI projects (#5577) 2024-11-05 10:24:45 -08:00
Stephen Toub 7e59b8b4a2 Add NativeAOT testapp project for M.E.AI (#5573)
* Add NativeAOT testapp project for M.E.AI

* Address PR feedback
2024-11-05 10:24:23 -08:00
Jose Perez Rodriguez c78c7b1681 Merged PR 44426: Merging release/9.0 into internal/release/9.0
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request introduces new scripts and classes to enhance the functionality of the repository.
- Added `Get-RepoDigest.ps1` script to generate a repository digest report.
- Added `AzureAIInferenceEmbeddingGenerator.cs` to support embedding generation using Azure AI Inference.
- Added `repo-digest-template.html` to serve as a template for the repository digest report.
2024-10-25 23:54:26 +00:00
Jose Perez Rodriguez 5a850c70b1 Update feeds to use latest builds from .NET 2024-10-25 16:12:23 -07:00
Jose Perez Rodriguez d26fc773d1 Merge branch release/9.0 into internal/release/9.0 2024-10-25 15:21:47 -07:00
Jose Perez Rodriguez 7574980e14 Merge branch main into release/9.0 2024-10-25 14:27:41 -07:00
Jose Perez Rodriguez 0a834da615 Merge changes from release/8.10 branch 2024-10-25 12:19:11 -07:00
Stephen Toub 7fe79a39d7
Update M.E.AI.AzureAIInference for its beta2 release (#5558)
- Adapt to breaking changes
- Temporarily work around lack of Index on streaming updates
- Add streaming usage support
- Add an embedding generator
2024-10-24 23:59:54 +00:00
Stephen Toub 4bff11ab4e
Work around fixed bug in System.Memory.Data (#5569)
* Workaround fixed bug in System.Memory.Data

BinaryData had a bug in its ToString that would throw an exception if _bytes was empty. That was fixed several years ago, but Azure SDK libraries are still referencing older versions of System.Memory.Data that don't have the fix.

* Add pragma warning and update condition check
2024-10-24 20:13:03 +00:00
Steve Sanderson 46d5e57ca7
Structured output improvements (continuation of PR 5522) (#5560) 2024-10-24 13:10:13 +01:00
Stephen Toub cb16d5d6e6
Add EmbeddingGeneratorOptions.Dimensions (#5563) 2024-10-24 08:01:01 -04:00
Stephen Toub a5e5e8c489
Remove some defunct lazy init from chat clients (#5561) 2024-10-24 08:00:42 -04:00
Stephen Toub 2616bb8eb9
Add string constructor to OllamaEmbeddingGenerator (#5562)
We'd previously added one to OllamaChatClient but neglected to add one here.
2024-10-24 08:00:28 -04:00
Stephen Toub 8352f82722
Fix cloning of ChatOptions.TopK (#5564) 2024-10-24 08:00:14 -04:00
Igor Velikorossov f9ce7f877d
Update .gitattributes (#5565) 2024-10-24 00:47:42 +00:00
Stephen Toub 479b67e127
Improve EmbeddingGeneratorExtensions (#5551)
* Improve EmbeddingGeneratorExtensions

- Renames GenerateAsync extension method (not the interface method) to be GenerateEmbeddingAsync, since it produces a single TEmbedding
- Adds GenerateEmbeddingVectorAsync, which returns a `ReadOnlyMemory<T>`
- Adds a GenerateAndZipEmbeddingsAsync, which creates a `List<KeyValuePair<TInput, TEmbedding>>` that pairs the inputs with the outputs.

* Address PR feedback
2024-10-23 17:43:40 -04:00
Igor Velikorossov 696389c9b8
Script to generate weekly digest (#5550) 2024-10-23 17:29:31 +11:00
Jose Perez Rodriguez 0968e75afa Merged PR 44144: Enable producing stable versions and flow dependencies from aspnetcore and ru...
Enable producing stable versions and flow dependencies from aspnetcore and runtime

----
#### AI description  (iteration 1)
#### PR Classification
Dependency update

#### PR Summary
This pull request updates various dependencies to their stable versions and adjusts build configurations to support stable version production.
- Updated dependency versions from `9.0.0-rc.2` to `9.0.0` in `/eng/Version.Details.xml` and `/eng/Versions.props`.
- Modified `NuGet.config` to update package sources and disable certain internal feeds.
- Adjusted build pipeline configurations in `/azure-pipelines.yml` to remove the code coverage stage and disable source indexing.
- Added `SuppressFinalPackageVersion` property in multiple `.csproj` files to prevent final package versioning during development stages.
- Disabled NU1507 warning in `Directory.Build.props` for internal branches.
2024-10-22 20:04:29 +00:00
Jose Perez Rodriguez 424e9748b0 Fix official build by resolving conflict when building the docs transport package 2024-10-22 09:51:54 -07:00
Stephen Toub 7cac12be44
Fix a few issues in IChatClient implementations (#5549)
* Fix a few issues in IChatClient implementations

- Avoid null arg exception when constructing system message with null text
- Avoid empty exception when constructing user message with no parts
- Use all parts rather than just first text part for system message
- Handle assistant messages with both content and tools
- Avoid unnecessarily trying to weed out duplicate call ids

* Address PR feedback

- Normalize null to string.Empty in TextContent
- Ensure GetContentParts always produces at least one part, even if empty text content
2024-10-22 11:10:50 -04:00
Stephen Toub 2dd959f508
Add OllamaChatClient ctor with string endpoint (#5553) 2024-10-22 05:58:28 -04:00
Stephen Toub 8fbeca0932
Add missing [JsonIgnore] on ChatCompletion.Message (#5552)
This property is an accelerator into Choices. It's already serialized as part of Choices and shouldn't be duplicated.
2024-10-22 05:58:03 -04:00
Stephen Toub ccd86d9046
Lower M.E.AI.Ollama STJ dependency back to 8 (#5554) 2024-10-22 05:57:37 -04:00
Stephen Toub aa63ac73f8
Fix embedding integration test after telemetry updates (#5555) 2024-10-22 05:46:18 -04:00
Stephen Toub 651546f3a0
Remove AIContent.ModelId, add StreamingChatCompletionUpdate.ModelId (#5535) 2024-10-21 21:51:57 -04:00
Stephen Toub e1eb9bdbe3
Make GenerateAsync extension just return the embedding (#5543) 2024-10-21 21:16:53 -04:00
Stephen Toub 1622413995
Remove unnecessary ctors from FunctionResultContent (#5536) 2024-10-21 21:15:53 -04:00
Stephen Toub cd4dc68991
Fix typo in ChatCompletions comment (#5545) 2024-10-21 10:10:23 -04:00
Makazeu bdbda81643
Update the meter names of NetworkMetrics to match other meters in ResourceMonitoring (#5541)
* Update the meter names in ResourceMonitoring

* Add Unit Tests
2024-10-21 13:52:32 +02:00
Jose Perez Rodriguez eafdf6e9c4
Use 8.0 era dependencies for non net9.0 TFMs (#5470)
* Use 8.0 era dependencies for non net9.0 TFMs

* PR Feedback.

* Apply suggestions from code review

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>

* Split files per feedback and update dependency versions to latest servicing and RC2

* Removing latest version from Microsoft.Extensions.AI.Abstractions

* Removing unnecessary package reference

* Also removing property from AzureAIInference project

---------

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2024-10-19 01:55:05 +00:00
Stephen Toub 8690e7a0ea
Update UseOpenTelemetry for latest genai spec updates (#5532)
* Update UseOpenTelemetry for latest genai spec updates

- Events are now expected to be emitted as body fields, and the newly-recommended way to achieve that is via ILogger. So UseOpenTelemetry now takes an optional logger that it uses for emitting such data.
- I restructured the implementation to reduce duplication.
- Added logging of response format and seed.
- Added ChatOptions.TopK, as it's one of the parameters considered special by the spec.
- Updated the Azure.AI.Inference provider name to match the convention and what the library itself uses
- Updated the OpenAI client to use openai regardless of the kind of the actual client being used, per spec and recommendation

* Address PR feedback
2024-10-17 16:55:17 -04:00
Eirik Tsarpalis 8eddb547b0
Address PR feedback from https://github.com/dotnet/extensions/pull/5513 (#5533) 2024-10-17 15:51:06 -04:00
Eirik Tsarpalis d894f98ff8
Expose an `AIJsonUtilities` class in M.E.AI and lower M.E.AI.Abstractions to STJv8 (#5513)
* Expose FunctionCallUtilities class.

* Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/FunctionCallUtilities.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

* Remove function call formatting helpers.

* Extract JSON schema inference settings into a separate options class.

* Update src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/JsonSchemaInferenceOptions.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

* Address feedback

* Return FunctionCallContent in parser helpers.

* Address feedback

* Update src/Libraries/Microsoft.Extensions.AI/Functions/AIFunctionFactory.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

* Refactor to AIJsonUtilities class.

* Move all utilities to M.E.AI and downgrade STJ version to 8 for M.E.AI.Abstractions.

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2024-10-17 12:26:04 -04:00
dotnet-maestro[bot] ea3b0dbe6a
Update dependencies from https://github.com/dotnet/arcade build 20241016.2 (#5530)
[main] Update dependencies from dotnet/arcade
2024-10-16 22:12:37 +00:00
Stephen Toub ef606f2e1f
Add AdditionalPropertiesDictionary.TryGetValue<T> (#5528)
* Add AdditionalPropertiesDictionary.TryGetValue<T>

* Update comments
2024-10-16 10:59:06 -04:00
Stephen Toub 87308c7919
Update README with rate limiting example (#5519)
Replace the logging examples as there's already a built-in logging implementation.
2024-10-14 12:59:49 -04:00
Stephen Toub 412305bd1a
Add thread-safety comments about M.E.AI middleware components (#5515) 2024-10-12 13:12:56 +01:00
Stephen Toub e0c9a82fed
Improve CachingChatClient's coalescing of streaming updates (#5514)
* Improve CachingChatClient's coalescing of streaming updates

- Avoid O(N^2) memory allocation in the length of the received text
- Propagate additional metadata from coalesced nodes
- Propagate metadata on the coalesced TextContent, like ModelId
- Expose whether to coalesce as a setting on the client

* Remove dictionary merging until we have evidence it's warranted
2024-10-12 07:27:25 -04:00
Eirik Tsarpalis 62497790a1
Rework the AIFunctionFactory APIs and remove redundant overloads following removal of trimmer annotations. (#5510) 2024-10-11 18:47:23 +01:00
Steve Sanderson a8e910a983
Build fix - remove unnecessary 'using' (#5512) 2024-10-11 17:18:14 +01:00
Stephen Toub 99fdb98b30
Add comment about use of hashing in CachingHelpers (#5509) 2024-10-11 12:07:02 -04:00
Steve Sanderson 22d55bf081
Build fix - remove unnecessary 'using' 2024-10-11 16:48:20 +01:00
Eirik Tsarpalis 02eba55d35 Rework the `MethodInfo` overload to match `Delegate` overload. 2024-10-11 14:28:10 +01:00
Eirik Tsarpalis 65fb55f6f3 Make parameter nullable again. 2024-10-11 14:21:10 +01:00
Eirik Tsarpalis b708fa905c Reinstate null check. 2024-10-11 14:13:13 +01:00
Eirik Tsarpalis 5ff9c74475 Rework the AIFunctionFactory APIs and remove redundant overloads following removal of trimmer annotations. 2024-10-11 14:10:25 +01:00
Stephen Toub dbab2572a5
Avoid use of FormattableString when logging (#5503) 2024-10-11 08:57:07 -04:00
Stephen Toub 85e70b03ec
Use the logging generator in LoggingChatClient / LoggingEmbeddingGenerator (#5508) 2024-10-11 08:56:40 -04:00
Eirik Tsarpalis 058d827998
Use the same JsonSerializerOptions default in all locations. (#5507) 2024-10-10 19:18:16 -04:00