Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<EncryptionOfficialVersion>2.0.5</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.1.0</EncryptionPreviewVersion>
<EncryptionPreviewSuffixVersion>preview5</EncryptionPreviewSuffixVersion>
<CosmosAIOfficialVersion>1.0.0</CosmosAIOfficialVersion>
<CosmosAIPreviewVersion>1.0.0</CosmosAIPreviewVersion>
<CosmosAIPreviewSuffixVersion>preview.0</CosmosAIPreviewSuffixVersion>
<CustomEncryptionVersion>1.0.0-preview08</CustomEncryptionVersion>
<HybridRowVersion>1.1.0-preview3</HybridRowVersion>
<LangVersion>10.0</LangVersion>
Expand Down
4 changes: 4 additions & 0 deletions Microsoft.Azure.Cosmos.AI/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
</Project>
7 changes: 7 additions & 0 deletions Microsoft.Azure.Cosmos.AI/src/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Microsoft.Azure.Cosmos.AI.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100197c25d0a04f73cb271e8181dba1c0c713df8deebb25864541a66670500f34896d280484b45fe1ff6c29f2ee7aa175d8bcbd0c83cc23901a894a86996030f6292ce6eda6e6f3e6c74b3c5a3ded4903c951e6747e6102969503360f7781bf8bf015058eb89b7621798ccc85aaca036ff1bc1556bb7f62de15908484886aa8bbae")]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the .NET org, they have a task to generate this at build time so that you don't have to look at the PublicKey in source, not important, as this works too, but might be interesting to look at.

373 changes: 373 additions & 0 deletions Microsoft.Azure.Cosmos.AI/src/AzureOpenAIEmbeddingGenerator.cs

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions Microsoft.Azure.Cosmos.AI/src/Microsoft.Azure.Cosmos.AI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Microsoft.Azure.Cosmos.AI</AssemblyName>
<RootNamespace>Microsoft.Azure.Cosmos.AI</RootNamespace>
<LangVersion>$(LangVersion)</LangVersion>
<!-- This package depends on ICosmosEmbeddingGenerator and EmbeddingSource which are
#if PREVIEW-gated public types in the core SDK. Setting IsPreview=true here ensures
Directory.Build.props adds the PREVIEW compile symbol for this project (and transitively
for the core SDK when using ProjectReference via AdditionalProperties), so VS and plain
'dotnet build' both work without passing /p:IsPreview=true on the command line. -->
<IsPreview>true</IsPreview>
<CosmosAIVersion Condition=" '$(IsPreview)' != 'true' ">$(CosmosAIOfficialVersion)</CosmosAIVersion>
<CosmosAIVersion Condition=" '$(IsPreview)' == 'true' ">$(CosmosAIPreviewVersion)</CosmosAIVersion>
<CosmosAIVersionSuffix Condition=" '$(IsPreview)' == 'true' ">$(CosmosAIPreviewSuffixVersion)</CosmosAIVersionSuffix>
<Version Condition=" '$(CosmosAIVersionSuffix)' == '' ">$(CosmosAIVersion)</Version>
<Version Condition=" '$(CosmosAIVersionSuffix)' != '' ">$(CosmosAIVersion)-$(CosmosAIVersionSuffix)</Version>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd))</CurrentDate>
<Company>Microsoft Corporation</Company>
<Authors>Microsoft</Authors>
<Description>AI extensions library for Azure Cosmos DB for NoSQL. Provides an Azure OpenAI / Foundry-backed embedding provider for automatic vector embedding generation in hybrid and vector search queries. Designed to be extensible for broader AI scenarios including semantic re-ranking, OCR, and model integrations. For more information, refer to https://aka.ms/CosmosDB</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<Title>Microsoft Azure Cosmos DB AI extensions library</Title>
<PackageId>Microsoft.Azure.Cosmos.AI</PackageId>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Azure/azure-cosmos-dotnet-v3</PackageProjectUrl>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageTags>microsoft;azure;cosmos;cosmosdb;documentdb;nosql;azureofficial;dotnetcore;netcore;netstandard;ai;embedding;vector;openai;semanticranking</PackageTags>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\..\Microsoft.Azure.Cosmos\src\stylecop.json" Link="stylecop.json" />
</ItemGroup>

<!-- Core SDK reference: project ref when building from source, otherwise NuGet pin.
This package depends on ICosmosEmbeddingGenerator and EmbeddingSource which are
#if PREVIEW-gated in the core SDK, so we always need a preview-built SDK.
- ProjectReference: AdditionalProperties forces IsPreview=true on the core SDK build
so the preview-gated types are compiled as public, without requiring the caller
to pass /p:IsPreview=true globally.
- NuGet: always reference the preview version (preview NuGet is built with PREVIEW defined). -->
<ItemGroup Condition=" '$(SdkProjectRef)' != 'True' ">
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.60.0-preview.0" />
</ItemGroup>

<ItemGroup Condition=" '$(SdkProjectRef)' == 'True' ">
<ProjectReference Include="..\..\Microsoft.Azure.Cosmos\src\Microsoft.Azure.Cosmos.csproj"
AdditionalProperties="IsPreview=true" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\Icon.png" Pack="true" PackagePath=""/>
</ItemGroup>

<!-- Required by Microsoft.Azure.Cosmos SDK; PrivateAssets=All keeps it off the public dependency graph -->
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" NoWarn="NU1903" PrivateAssets="All" />
</ItemGroup>

<!-- Azure OpenAI provider dependency -->
<ItemGroup>
<PackageReference Include="Azure.AI.OpenAI" Version="2.1.0" />
</ItemGroup>

<!-- Analyzers -->
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.0.102" PrivateAssets="All" />
</ItemGroup>

<!-- Strong-name signing -->
<PropertyGroup>
<SigningType>Product</SigningType>
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\..\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup Condition=" '$(SdkProjectRef)' == 'True' ">
<DefineSdkProjectRefSymbol Condition=" '$(DefineSdkProjectRefSymbol)' == '' ">true</DefineSdkProjectRefSymbol>
</PropertyGroup>

<PropertyGroup Condition=" '$(DefineSdkProjectRefSymbol)' == 'true' ">
<DefineConstants>$(DefineConstants);SDKPROJECTREF</DefineConstants>
</PropertyGroup>
</Project>
Loading
Loading