-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added AI Orchestration classes along with LLM tasks
- Loading branch information
1 parent
28f4874
commit 0970dcf
Showing
18 changed files
with
1,432 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Newtonsoft.Json.Converters; | ||
using System.Runtime.Serialization; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Conductor.Client.Ai | ||
{ | ||
public class Configuration | ||
{ | ||
/// <summary> | ||
/// Defines LLMProvider | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum LLMProviderEnum | ||
{ | ||
/// <summary> | ||
/// Enum AZURE_OPEN_AI for value: azure_openai | ||
/// </summary> | ||
[EnumMember(Value = "azure_openai")] | ||
AZURE_OPEN_AI = 1, | ||
|
||
/// <summary> | ||
/// Enum OPEN_AI for value: openai | ||
/// </summary> | ||
[EnumMember(Value = "openai")] | ||
OPEN_AI = 2, | ||
|
||
/// <summary> | ||
/// Enum GCP_VERTEX_AI for value: vertex_ai | ||
/// </summary> | ||
[EnumMember(Value = "vertex_ai")] | ||
GCP_VERTEX_AI = 3, | ||
|
||
/// <summary> | ||
/// Enum HUGGING_FACE for value: huggingface | ||
/// </summary> | ||
[EnumMember(Value = "huggingface")] | ||
HUGGING_FACE = 4, | ||
} | ||
|
||
/// <summary> | ||
/// Defines VectorDB | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum VectorDBEnum | ||
{ | ||
/// <summary> | ||
/// Enum PINECONE_DB for value: pineconedb | ||
/// </summary> | ||
[EnumMember(Value = "pineconedb")] | ||
PINECONE_DB = 1, | ||
|
||
/// <summary> | ||
/// Enum WEAVIATE_DB for value: weaviatedb | ||
/// </summary> | ||
[EnumMember(Value = "weaviatedb")] | ||
WEAVIATE_DB = 2, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
using System.Collections.Generic; | ||
using EnvironmentInstance = System.Environment; | ||
|
||
namespace Conductor.Client.Ai | ||
{ | ||
/// <summary> | ||
/// Integration configuration abstract base class. | ||
/// </summary> | ||
public abstract class IntegrationConfig | ||
{ | ||
/// <summary> | ||
/// Converts the configuration to a dictionary. | ||
/// </summary> | ||
/// <returns>A dictionary representation of the configuration.</returns> | ||
public abstract Dictionary<string, object> ToDictionary(); | ||
} | ||
|
||
/// <summary> | ||
/// Configuration class for Weaviate integration. | ||
/// </summary> | ||
public class WeaviateConfig : IntegrationConfig | ||
{ | ||
/// <summary> | ||
/// Gets or Sets ApiKey | ||
/// </summary> | ||
public string ApiKey { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets Endpoint | ||
/// </summary> | ||
public string Endpoint { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets Class | ||
/// </summary> | ||
public string ClassName { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="WeaviateConfig" /> class | ||
/// </summary> | ||
/// <param name="apiKey"></param> | ||
/// <param name="endpoint"></param> | ||
/// <param name="className"></param> | ||
public WeaviateConfig(string apiKey, string endpoint, string className) | ||
{ | ||
ApiKey = apiKey; | ||
Endpoint = endpoint; | ||
ClassName = className; | ||
} | ||
|
||
/// <summary> | ||
/// Inherited method | ||
/// </summary> | ||
/// <returns></returns> | ||
public override Dictionary<string, object> ToDictionary() | ||
{ | ||
return new Dictionary<string, object> | ||
{ | ||
{ Constants.APIKEY, ApiKey }, | ||
{ Constants.ENDPOINT, Endpoint } | ||
}; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Configuration class for OpenAIConfig integration. | ||
/// </summary> | ||
public class OpenAIConfig : IntegrationConfig | ||
{ | ||
/// <summary> | ||
/// Gets or Sets ApiKey | ||
/// </summary> | ||
public string ApiKey { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="OpenAIConfig" /> class | ||
/// </summary> | ||
/// <param name="apiKey"></param> | ||
public OpenAIConfig(string apiKey = null) | ||
{ | ||
ApiKey = apiKey ?? EnvironmentInstance.GetEnvironmentVariable(Constants.OPENAIAPIKEY); | ||
} | ||
|
||
/// <summary> | ||
/// Inherited method | ||
/// </summary> | ||
/// <returns></returns> | ||
public override Dictionary<string, object> ToDictionary() | ||
{ | ||
return new Dictionary<string, object> | ||
{ | ||
{ Constants.APIKEY, ApiKey } | ||
}; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Configuration class for AzureOpenAIConfig integration. | ||
/// </summary> | ||
public class AzureOpenAIConfig : IntegrationConfig | ||
{ | ||
/// <summary> | ||
/// Gets or Sets ApiKey | ||
/// </summary> | ||
public string ApiKey { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets Endpoint | ||
/// </summary> | ||
public string Endpoint { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="AzureOpenAIConfig" /> class | ||
/// </summary> | ||
/// <param name="apiKey"></param> | ||
/// <param name="endpoint"></param> | ||
public AzureOpenAIConfig(string apiKey, string endpoint) | ||
{ | ||
ApiKey = apiKey; | ||
Endpoint = endpoint; | ||
} | ||
|
||
/// <summary> | ||
/// Inherited method | ||
/// </summary> | ||
/// <returns></returns> | ||
public override Dictionary<string, object> ToDictionary() | ||
{ | ||
return new Dictionary<string, object> | ||
{ | ||
{ Constants.APIKEY, ApiKey }, | ||
{ Constants.ENDPOINT, Endpoint } | ||
}; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Configuration class for PineconeConfig integration. | ||
/// </summary> | ||
public class PineconeConfig : IntegrationConfig | ||
{ | ||
/// <summary> | ||
/// Gets or Sets ApiKey | ||
/// </summary> | ||
public string ApiKey { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets Endpoint | ||
/// </summary> | ||
public string Endpoint { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets Environment | ||
/// </summary> | ||
public string Environment { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets ProjectName | ||
/// </summary> | ||
public string ProjectName { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PineconeConfig" /> class | ||
/// </summary> | ||
/// <param name="apiKey"></param> | ||
/// <param name="endpoint"></param> | ||
/// <param name="environment"></param> | ||
/// <param name="projectName"></param> | ||
public PineconeConfig(string apiKey = null, string endpoint = null, string environment = null, string projectName = null) | ||
{ | ||
ApiKey = apiKey ?? EnvironmentInstance.GetEnvironmentVariable(Constants.PINECONEAPIKEY); | ||
Endpoint = endpoint ?? EnvironmentInstance.GetEnvironmentVariable(Constants.PINECONEENDPOINT); | ||
Environment = environment ?? EnvironmentInstance.GetEnvironmentVariable(Constants.PINECONEENV); | ||
ProjectName = projectName ?? EnvironmentInstance.GetEnvironmentVariable(Constants.PINECONEPROJECT); | ||
} | ||
|
||
/// <summary> | ||
/// Inherited method | ||
/// </summary> | ||
/// <returns></returns> | ||
public override Dictionary<string, object> ToDictionary() | ||
{ | ||
return new Dictionary<string, object> | ||
{ | ||
{ Constants.APIKEY, ApiKey }, | ||
{ Constants.ENDPOINT, Endpoint }, | ||
{ Constants.PROJECTNAME, ProjectName }, | ||
{ Constants.ENVIRONMENT, Environment } | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.