Skip to content

Commit 6545c2f

Browse files
got rid of the CM name (Azure#48320)
* got rid of the CM name * updated api file * updated api file * pr feedback
1 parent 9ae3d1f commit 6545c2f

File tree

57 files changed

+424
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+424
-549
lines changed

sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.net8.0.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Azure.CloudMachine.OpenAI
1+
namespace Azure.Projects.OpenAI
22
{
33
public enum AIModelKind
44
{
@@ -8,7 +8,7 @@ public enum AIModelKind
88
public static partial class AzureOpenAIExtensions
99
{
1010
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, OpenAI.Chat.ChatCompletion completion) { }
11-
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, System.Collections.Generic.IEnumerable<Azure.CloudMachine.OpenAI.VectorbaseEntry> entries) { }
11+
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, System.Collections.Generic.IEnumerable<Azure.Projects.OpenAI.VectorbaseEntry> entries) { }
1212
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, System.Collections.Generic.IEnumerable<OpenAI.Chat.ToolChatMessage> toolCallResults) { }
1313
public static string AsText(this OpenAI.Chat.ChatCompletion completion) { throw null; }
1414
public static string AsText(this OpenAI.Chat.ChatMessageContent content) { throw null; }
@@ -26,30 +26,30 @@ public void Add(System.Type functions) { }
2626
public string Call(OpenAI.Chat.ChatToolCall call) { throw null; }
2727
public string Call(string name, object[] arguments) { throw null; }
2828
public System.Collections.Generic.IEnumerable<OpenAI.Chat.ToolChatMessage> CallAll(System.Collections.Generic.IEnumerable<OpenAI.Chat.ChatToolCall> toolCalls) { throw null; }
29-
public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.CloudMachine.OpenAI.ChatTools tools) { throw null; }
29+
public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.Projects.OpenAI.ChatTools tools) { throw null; }
3030
}
3131
public partial class EmbeddingsVectorbase
3232
{
33-
public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.CloudMachine.OpenAI.VectorbaseStore? store = null, int factChunkSize = 1000) { }
33+
public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.Projects.OpenAI.VectorbaseStore? store = null, int factChunkSize = 1000) { }
3434
public void Add(System.BinaryData data) { }
3535
public void Add(string text) { }
36-
public System.Collections.Generic.IEnumerable<Azure.CloudMachine.OpenAI.VectorbaseEntry> Find(string text, Azure.CloudMachine.OpenAI.FindOptions? options = null) { throw null; }
36+
public System.Collections.Generic.IEnumerable<Azure.Projects.OpenAI.VectorbaseEntry> Find(string text, Azure.Projects.OpenAI.FindOptions? options = null) { throw null; }
3737
}
3838
public partial class FindOptions
3939
{
4040
public FindOptions() { }
4141
public int MaxEntries { get { throw null; } set { } }
4242
public float Threshold { get { throw null; } set { } }
4343
}
44-
public partial class OpenAIModelFeature : Azure.CloudMachine.Core.CloudMachineFeature
44+
public partial class OpenAIModelFeature : Azure.Projects.Core.AzureProjectFeature
4545
{
46-
public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine.OpenAI.AIModelKind kind = Azure.CloudMachine.OpenAI.AIModelKind.Chat) { }
46+
public OpenAIModelFeature(string model, string modelVersion, Azure.Projects.OpenAI.AIModelKind kind = Azure.Projects.OpenAI.AIModelKind.Chat) { }
4747
public string Model { get { throw null; } }
4848
public string ModelVersion { get { throw null; } }
4949
public Azure.Core.ClientConnection CreateConnection(string cmId) { throw null; }
5050
protected override void EmitConnections(System.Collections.Generic.ICollection<Azure.Core.ClientConnection> connections, string cmId) { }
51-
protected override void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { }
52-
protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm) { throw null; }
51+
protected override void EmitFeatures(Azure.Projects.Core.FeatureCollection features, string cmId) { }
52+
protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.Projects.ProjectInfrastructure cm) { throw null; }
5353
}
5454
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
5555
public readonly partial struct VectorbaseEntry
@@ -64,9 +64,9 @@ public readonly partial struct VectorbaseEntry
6464
public abstract partial class VectorbaseStore
6565
{
6666
protected VectorbaseStore() { }
67-
public abstract int Add(Azure.CloudMachine.OpenAI.VectorbaseEntry entry);
68-
public abstract void Add(System.Collections.Generic.IReadOnlyList<Azure.CloudMachine.OpenAI.VectorbaseEntry> entry);
67+
public abstract int Add(Azure.Projects.OpenAI.VectorbaseEntry entry);
68+
public abstract void Add(System.Collections.Generic.IReadOnlyList<Azure.Projects.OpenAI.VectorbaseEntry> entry);
6969
public static float CosineSimilarity(System.ReadOnlySpan<float> x, System.ReadOnlySpan<float> y) { throw null; }
70-
public abstract System.Collections.Generic.IEnumerable<Azure.CloudMachine.OpenAI.VectorbaseEntry> Find(System.ReadOnlyMemory<float> vector, Azure.CloudMachine.OpenAI.FindOptions options);
70+
public abstract System.Collections.Generic.IEnumerable<Azure.Projects.OpenAI.VectorbaseEntry> Find(System.ReadOnlyMemory<float> vector, Azure.Projects.OpenAI.FindOptions options);
7171
}
7272
}

sdk/cloudmachine/Azure.CloudMachine.OpenAI/api/Azure.CloudMachine.OpenAI.netstandard2.0.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Azure.CloudMachine.OpenAI
1+
namespace Azure.Projects.OpenAI
22
{
33
public enum AIModelKind
44
{
@@ -8,7 +8,7 @@ public enum AIModelKind
88
public static partial class AzureOpenAIExtensions
99
{
1010
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, OpenAI.Chat.ChatCompletion completion) { }
11-
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, System.Collections.Generic.IEnumerable<Azure.CloudMachine.OpenAI.VectorbaseEntry> entries) { }
11+
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, System.Collections.Generic.IEnumerable<Azure.Projects.OpenAI.VectorbaseEntry> entries) { }
1212
public static void Add(this System.Collections.Generic.List<OpenAI.Chat.ChatMessage> messages, System.Collections.Generic.IEnumerable<OpenAI.Chat.ToolChatMessage> toolCallResults) { }
1313
public static string AsText(this OpenAI.Chat.ChatCompletion completion) { throw null; }
1414
public static string AsText(this OpenAI.Chat.ChatMessageContent content) { throw null; }
@@ -26,30 +26,30 @@ public void Add(System.Type functions) { }
2626
public string Call(OpenAI.Chat.ChatToolCall call) { throw null; }
2727
public string Call(string name, object[] arguments) { throw null; }
2828
public System.Collections.Generic.IEnumerable<OpenAI.Chat.ToolChatMessage> CallAll(System.Collections.Generic.IEnumerable<OpenAI.Chat.ChatToolCall> toolCalls) { throw null; }
29-
public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.CloudMachine.OpenAI.ChatTools tools) { throw null; }
29+
public static implicit operator OpenAI.Chat.ChatCompletionOptions (Azure.Projects.OpenAI.ChatTools tools) { throw null; }
3030
}
3131
public partial class EmbeddingsVectorbase
3232
{
33-
public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.CloudMachine.OpenAI.VectorbaseStore? store = null, int factChunkSize = 1000) { }
33+
public EmbeddingsVectorbase(OpenAI.Embeddings.EmbeddingClient client, Azure.Projects.OpenAI.VectorbaseStore? store = null, int factChunkSize = 1000) { }
3434
public void Add(System.BinaryData data) { }
3535
public void Add(string text) { }
36-
public System.Collections.Generic.IEnumerable<Azure.CloudMachine.OpenAI.VectorbaseEntry> Find(string text, Azure.CloudMachine.OpenAI.FindOptions? options = null) { throw null; }
36+
public System.Collections.Generic.IEnumerable<Azure.Projects.OpenAI.VectorbaseEntry> Find(string text, Azure.Projects.OpenAI.FindOptions? options = null) { throw null; }
3737
}
3838
public partial class FindOptions
3939
{
4040
public FindOptions() { }
4141
public int MaxEntries { get { throw null; } set { } }
4242
public float Threshold { get { throw null; } set { } }
4343
}
44-
public partial class OpenAIModelFeature : Azure.CloudMachine.Core.CloudMachineFeature
44+
public partial class OpenAIModelFeature : Azure.Projects.Core.AzureProjectFeature
4545
{
46-
public OpenAIModelFeature(string model, string modelVersion, Azure.CloudMachine.OpenAI.AIModelKind kind = Azure.CloudMachine.OpenAI.AIModelKind.Chat) { }
46+
public OpenAIModelFeature(string model, string modelVersion, Azure.Projects.OpenAI.AIModelKind kind = Azure.Projects.OpenAI.AIModelKind.Chat) { }
4747
public string Model { get { throw null; } }
4848
public string ModelVersion { get { throw null; } }
4949
public Azure.Core.ClientConnection CreateConnection(string cmId) { throw null; }
5050
protected override void EmitConnections(System.Collections.Generic.ICollection<Azure.Core.ClientConnection> connections, string cmId) { }
51-
protected override void EmitFeatures(Azure.CloudMachine.Core.FeatureCollection features, string cmId) { }
52-
protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.CloudMachine.ProjectInfrastructure cm) { throw null; }
51+
protected override void EmitFeatures(Azure.Projects.Core.FeatureCollection features, string cmId) { }
52+
protected override Azure.Provisioning.Primitives.ProvisionableResource EmitResources(Azure.Projects.ProjectInfrastructure cm) { throw null; }
5353
}
5454
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
5555
public readonly partial struct VectorbaseEntry
@@ -64,9 +64,9 @@ public readonly partial struct VectorbaseEntry
6464
public abstract partial class VectorbaseStore
6565
{
6666
protected VectorbaseStore() { }
67-
public abstract int Add(Azure.CloudMachine.OpenAI.VectorbaseEntry entry);
68-
public abstract void Add(System.Collections.Generic.IReadOnlyList<Azure.CloudMachine.OpenAI.VectorbaseEntry> entry);
67+
public abstract int Add(Azure.Projects.OpenAI.VectorbaseEntry entry);
68+
public abstract void Add(System.Collections.Generic.IReadOnlyList<Azure.Projects.OpenAI.VectorbaseEntry> entry);
6969
public static float CosineSimilarity(System.ReadOnlySpan<float> x, System.ReadOnlySpan<float> y) { throw null; }
70-
public abstract System.Collections.Generic.IEnumerable<Azure.CloudMachine.OpenAI.VectorbaseEntry> Find(System.ReadOnlyMemory<float> vector, Azure.CloudMachine.OpenAI.FindOptions options);
70+
public abstract System.Collections.Generic.IEnumerable<Azure.Projects.OpenAI.VectorbaseEntry> Find(System.ReadOnlyMemory<float> vector, Azure.Projects.OpenAI.FindOptions options);
7171
}
7272
}

sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/AzureOpenAIExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using OpenAI.Chat;
1010
using OpenAI.Embeddings;
1111

12-
namespace Azure.CloudMachine.OpenAI;
12+
namespace Azure.Projects.OpenAI;
1313

1414
/// <summary>
1515
/// The Azure OpenAI extensions.

sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/ChatTools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using System.Text.Json;
1111
using OpenAI.Chat;
1212

13-
namespace Azure.CloudMachine.OpenAI;
13+
namespace Azure.Projects.OpenAI;
1414

1515
/// <summary> The service client for the OpenAI Chat Completions endpoint. </summary>
1616
public class ChatTools

sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/EmbeddingsVectorbase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System;
66
using OpenAI.Embeddings;
77

8-
namespace Azure.CloudMachine.OpenAI;
8+
namespace Azure.Projects.OpenAI;
99

1010
/// <summary>
1111
/// The vectorbase for storing embeddings.

sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/MemoryVectorbaseStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Collections.Generic;
55
using System;
66

7-
namespace Azure.CloudMachine.OpenAI;
7+
namespace Azure.Projects.OpenAI;
88

99
internal class MemoryVectorbaseStore : VectorbaseStore
1010
{

sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIFeature.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
// Licensed under the MIT License.
33

44
using System.Collections.Generic;
5-
using Azure.CloudMachine.Core;
5+
using Azure.Projects.Core;
66
using Azure.Core;
77
using Azure.Provisioning.CognitiveServices;
88
using Azure.Provisioning.Primitives;
99

10-
namespace Azure.CloudMachine.OpenAI;
10+
namespace Azure.Projects.OpenAI;
1111

12-
internal class OpenAIFeature : CloudMachineFeature
12+
internal class OpenAIFeature : AzureProjectFeature
1313
{
1414
public OpenAIFeature()
1515
{ }
1616

17-
protected override ProvisionableResource EmitResources(ProjectInfrastructure cloudMachine)
17+
protected override ProvisionableResource EmitResources(ProjectInfrastructure infrastructure)
1818
{
19-
CognitiveServicesAccount cognitiveServices = CreateOpenAIAccount(cloudMachine);
20-
cloudMachine.AddResource(cognitiveServices);
19+
CognitiveServicesAccount cognitiveServices = CreateOpenAIAccount(infrastructure);
20+
infrastructure.AddResource(cognitiveServices);
2121

2222
RequiredSystemRoles.Add(cognitiveServices, [(CognitiveServicesBuiltInRole.GetBuiltInRoleName(CognitiveServicesBuiltInRole.CognitiveServicesOpenAIContributor) ,CognitiveServicesBuiltInRole.CognitiveServicesOpenAIContributor.ToString())]);
2323

sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/OpenAIModelFeature.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
using System;
55
using System.Collections.Generic;
66
using System.Linq;
7-
using Azure.CloudMachine.Core;
7+
using Azure.Projects.Core;
88
using Azure.Core;
99
using Azure.Provisioning.CognitiveServices;
1010
using Azure.Provisioning.Primitives;
1111

12-
namespace Azure.CloudMachine.OpenAI;
12+
namespace Azure.Projects.OpenAI;
1313

1414
/// <summary>
15-
/// CloudMachine feature for OpenAI models.
15+
/// Projects feature for OpenAI models.
1616
/// </summary>
17-
public class OpenAIModelFeature : CloudMachineFeature
17+
public class OpenAIModelFeature : AzureProjectFeature
1818
{
1919
/// <summary>
2020
/// Create a new OpenAI model feature.

sdk/cloudmachine/Azure.CloudMachine.OpenAI/src/VectorbaseStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Collections.Generic;
55
using System;
66

7-
namespace Azure.CloudMachine.OpenAI;
7+
namespace Azure.Projects.OpenAI;
88

99
/// <summary>
1010
/// The base class for a vectorbase store.

sdk/cloudmachine/Azure.CloudMachine.OpenAI/tests/CloudMachineTests_rag.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@
44
#nullable enable
55

66
using System;
7-
using System.Threading;
8-
using Azure.Security.KeyVault.Secrets;
9-
using Azure.CloudMachine.OpenAI;
10-
using Azure.CloudMachine.KeyVault;
7+
using Azure.Projects.OpenAI;
118
using NUnit.Framework;
129
using OpenAI.Chat;
1310
using Microsoft.Extensions.Configuration;
1411
using System.Collections.Generic;
1512
using Microsoft.Extensions.Primitives;
1613
using System.Linq;
1714
using System.IO;
18-
using System.Text.Json;
19-
using Azure.Storage.Blobs;
2015

21-
namespace Azure.CloudMachine.Tests;
16+
namespace Azure.Projects.Tests;
2217

23-
public partial class CloudMachineTests
18+
public partial class AzureProjectsTests
2419
{
2520
[Ignore("no recordings yet")]
2621
[Test]

0 commit comments

Comments
 (0)