Skip to content

Commit

Permalink
feat: Added Deep Infra Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
gunpal5 committed Apr 27, 2024
1 parent aa63c59 commit 687c0e2
Show file tree
Hide file tree
Showing 24 changed files with 1,355 additions and 8 deletions.
28 changes: 26 additions & 2 deletions LangChain.sln
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LangChain.Providers.Togethe
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mongo", "Mongo", "{07C5311E-E2E7-4F53-B837-A72196C54D8B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LangChain.Databases.Mongo", "src\Databases\Mongo\src\LangChain.Databases.Mongo.csproj", "{F4488CA6-9648-4467-862E-3C4A3CAAF5B4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LangChain.Databases.Mongo", "src\Databases\Mongo\src\LangChain.Databases.Mongo.csproj", "{F4488CA6-9648-4467-862E-3C4A3CAAF5B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LangChain.Databases.Mongo.IntegrationTests", "src\Databases\Mongo\test\LangChain.Databases.Mongo.IntegrationTests.csproj", "{E975CF2E-0D83-417B-A859-07BC028047D0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LangChain.Databases.Mongo.IntegrationTests", "src\Databases\Mongo\test\LangChain.Databases.Mongo.IntegrationTests.csproj", "{E975CF2E-0D83-417B-A859-07BC028047D0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DeepInfra", "DeepInfra", "{97A6B334-EB72-4B7E-A4EA-2073604DD94B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LangChain.Providers.DeepInfra", "src\Providers\DeepInfra\src\LangChain.Providers.DeepInfra.csproj", "{EF25353F-C816-4197-8E33-623600AC5A4F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LangChain.Providers.DeepInfra.Tests", "src\Providers\DeepInfra\tests\LangChain.Providers.DeepInfra.Tests.csproj", "{B94544AB-1A3E-4604-A094-0D63C91AA6B2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LangChain.Providers.DeepInfra.CodeGenerator", "src\Providers\DeepInfra\tools\LangChain.Providers.DeepInfra.CodeGenerator\LangChain.Providers.DeepInfra.CodeGenerator.csproj", "{44851579-7483-444F-BA01-E6D5427FFBFC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -720,6 +728,18 @@ Global
{E975CF2E-0D83-417B-A859-07BC028047D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E975CF2E-0D83-417B-A859-07BC028047D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E975CF2E-0D83-417B-A859-07BC028047D0}.Release|Any CPU.Build.0 = Release|Any CPU
{EF25353F-C816-4197-8E33-623600AC5A4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF25353F-C816-4197-8E33-623600AC5A4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF25353F-C816-4197-8E33-623600AC5A4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF25353F-C816-4197-8E33-623600AC5A4F}.Release|Any CPU.Build.0 = Release|Any CPU
{B94544AB-1A3E-4604-A094-0D63C91AA6B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B94544AB-1A3E-4604-A094-0D63C91AA6B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B94544AB-1A3E-4604-A094-0D63C91AA6B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B94544AB-1A3E-4604-A094-0D63C91AA6B2}.Release|Any CPU.Build.0 = Release|Any CPU
{44851579-7483-444F-BA01-E6D5427FFBFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44851579-7483-444F-BA01-E6D5427FFBFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44851579-7483-444F-BA01-E6D5427FFBFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44851579-7483-444F-BA01-E6D5427FFBFC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -860,6 +880,10 @@ Global
{07C5311E-E2E7-4F53-B837-A72196C54D8B} = {A098FF69-D8B5-4B2B-83D5-F777D3817F15}
{F4488CA6-9648-4467-862E-3C4A3CAAF5B4} = {07C5311E-E2E7-4F53-B837-A72196C54D8B}
{E975CF2E-0D83-417B-A859-07BC028047D0} = {07C5311E-E2E7-4F53-B837-A72196C54D8B}
{97A6B334-EB72-4B7E-A4EA-2073604DD94B} = {E2B9833C-0397-4FAF-A3A8-116E58749750}
{EF25353F-C816-4197-8E33-623600AC5A4F} = {97A6B334-EB72-4B7E-A4EA-2073604DD94B}
{B94544AB-1A3E-4604-A094-0D63C91AA6B2} = {97A6B334-EB72-4B7E-A4EA-2073604DD94B}
{44851579-7483-444F-BA01-E6D5427FFBFC} = {97A6B334-EB72-4B7E-A4EA-2073604DD94B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5C00D0F1-6138-4ED9-846B-97E43D6DFF1C}
Expand Down
14 changes: 14 additions & 0 deletions src/Providers/DeepInfra/src/DeepInfraConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using LangChain.Providers.OpenAI;

namespace LangChain.Providers.DeepInfra;

/// <summary>
///
/// </summary>
public class DeepInfraConfiguration : OpenAiConfiguration
{
/// <summary>
///
/// </summary>
public new const string SectionName = "DeepInfra";
}
24 changes: 24 additions & 0 deletions src/Providers/DeepInfra/src/DeepInfraModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using LangChain.Providers.OpenAI;
using OpenAI.Constants;

namespace LangChain.Providers.DeepInfra;

/// <summary>
/// </summary>
public class DeepInfraModel(DeepInfraProvider provider, ChatModels model) : OpenAiChatModel(provider, model)
{
public DeepInfraModel(DeepInfraProvider provider,
DeepInfraModelIds id) : this(provider, DeepInfraModelProvider.GetModelById(id))
{
}

public DeepInfraModel(DeepInfraProvider provider, string id) : this(provider, new ChatModels(
id,
0,
PricePerOutputTokenInUsd: 0.0,
PricePerInputTokenInUsd: 0.0))
{
}


}
Loading

0 comments on commit 687c0e2

Please sign in to comment.