Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup #10

Merged
merged 3 commits into from
Dec 21, 2023
Merged
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
2 changes: 2 additions & 0 deletions docs/api_refs/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"../../langchain/src/llms/openai.ts",
"../../langchain/src/llms/ai21.ts",
"../../langchain/src/llms/aleph_alpha.ts",
"./langchain/src/llms/azure_ml.ts",
"../../langchain/src/llms/cloudflare_workersai.ts",
"../../langchain/src/llms/cohere.ts",
"../../langchain/src/llms/hf.ts",
Expand Down Expand Up @@ -205,6 +206,7 @@
"../../langchain/src/chat_models/ollama.ts",
"../../langchain/src/chat_models/minimax.ts",
"../../langchain/src/chat_models/llama_cpp.ts",
"./langchain/src/chat_models/azure_ml.ts",
"../../langchain/src/chat_models/yandex.ts",
"../../langchain/src/chat_models/fake.ts",
"../../langchain/src/schema/index.ts",
Expand Down
22 changes: 22 additions & 0 deletions docs/core_docs/docs/integrations/chat/azure_ml.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Azure Machine Learning Chat

You must deploy models on Azure with the endpointUrl, apiKey, and deploymentName
when creating the AzureMLChatParams to call upon later. Must import a ContentFormatter
or create your own using the ChatContentFormatter interface.

```typescript
import {
AzureMLChatParams,
LlamaContentFormatter,
} from "langchain/chat_models/azure_ml";

const model = new AzureMLOnlineEndpoint({
endpointUrl: "YOUR_ENDPOINT_URL",
endpointApiKey: "YOUR_ENDPOINT_API_KEY",
deploymentName: "YOUR_MODEL_DEPLOYMENT_NAME",
contentFormatter: new LlamaContentFormatter(),
});

const res = model.invoke(["Foo"]);
console.log({ res });
```
22 changes: 22 additions & 0 deletions docs/core_docs/docs/integrations/llms/azure_ml.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Azure Machine Learning

You must deploy models on Azure with the endpointUrl, apiKey, and deploymentName
when creating the AzureMLOnlineEndpoint to call upon later. Must import a ContentFormatter
or create your own using the ContentFormatter interface.

```typescript
import {
AzureMLOnlineEndpoint,
LlamaContentFormatter,
} from "langchain/llms/azure_ml";

const model = new AzureMLOnlineEndpoint({
endpointUrl: "YOUR_ENDPOINT_URL",
endpointApiKey: "YOUR_ENDPOINT_API_KEY",
deploymentName: "YOUR_MODEL_DEPLOYMENT_NAME",
contentFormatter: new LlamaContentFormatter(),
});

const res = model.invoke("Foo");
console.log({ res });
```
2 changes: 2 additions & 0 deletions environment_tests/test-exports-bun/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export * from "langchain/llms/base";
export * from "langchain/llms/openai";
export * from "langchain/llms/ai21";
export * from "langchain/llms/aleph_alpha";
export * from "langchain/llms/azure_ml";
export * from "langchain/llms/cloudflare_workersai";
export * from "langchain/llms/ollama";
export * from "langchain/llms/fireworks";
Expand Down Expand Up @@ -57,6 +58,7 @@ export * from "langchain/chat_models/fireworks";
export * from "langchain/chat_models/baiduwenxin";
export * from "langchain/chat_models/ollama";
export * from "langchain/chat_models/minimax";
export * from "langchain/chat_models/azure_ml";
export * from "langchain/chat_models/yandex";
export * from "langchain/chat_models/fake";
export * from "langchain/schema";
Expand Down
2 changes: 2 additions & 0 deletions environment_tests/test-exports-cf/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export * from "langchain/llms/base";
export * from "langchain/llms/openai";
export * from "langchain/llms/ai21";
export * from "langchain/llms/aleph_alpha";
export * from "langchain/llms/azure_ml";
export * from "langchain/llms/cloudflare_workersai";
export * from "langchain/llms/ollama";
export * from "langchain/llms/fireworks";
Expand Down Expand Up @@ -57,6 +58,7 @@ export * from "langchain/chat_models/fireworks";
export * from "langchain/chat_models/baiduwenxin";
export * from "langchain/chat_models/ollama";
export * from "langchain/chat_models/minimax";
export * from "langchain/chat_models/azure_ml";
export * from "langchain/chat_models/yandex";
export * from "langchain/chat_models/fake";
export * from "langchain/schema";
Expand Down
2 changes: 2 additions & 0 deletions environment_tests/test-exports-cjs/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const llms_base = require("langchain/llms/base");
const llms_openai = require("langchain/llms/openai");
const llms_ai21 = require("langchain/llms/ai21");
const llms_aleph_alpha = require("langchain/llms/aleph_alpha");
const llms_azure_ml = require("langchain/llms/azure_ml");
const llms_cloudflare_workersai = require("langchain/llms/cloudflare_workersai");
const llms_ollama = require("langchain/llms/ollama");
const llms_fireworks = require("langchain/llms/fireworks");
Expand Down Expand Up @@ -57,6 +58,7 @@ const chat_models_fireworks = require("langchain/chat_models/fireworks");
const chat_models_baiduwenxin = require("langchain/chat_models/baiduwenxin");
const chat_models_ollama = require("langchain/chat_models/ollama");
const chat_models_minimax = require("langchain/chat_models/minimax");
const chat_models_azure_ml = require("langchain/chat_models/azure_ml");
const chat_models_yandex = require("langchain/chat_models/yandex");
const chat_models_fake = require("langchain/chat_models/fake");
const schema = require("langchain/schema");
Expand Down
2 changes: 2 additions & 0 deletions environment_tests/test-exports-esbuild/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import * as llms_base from "langchain/llms/base";
import * as llms_openai from "langchain/llms/openai";
import * as llms_ai21 from "langchain/llms/ai21";
import * as llms_aleph_alpha from "langchain/llms/aleph_alpha";
import * as llms_azure_ml from "langchain/llms/azure_ml";
import * as llms_cloudflare_workersai from "langchain/llms/cloudflare_workersai";
import * as llms_ollama from "langchain/llms/ollama";
import * as llms_fireworks from "langchain/llms/fireworks";
Expand Down Expand Up @@ -57,6 +58,7 @@ import * as chat_models_fireworks from "langchain/chat_models/fireworks";
import * as chat_models_baiduwenxin from "langchain/chat_models/baiduwenxin";
import * as chat_models_ollama from "langchain/chat_models/ollama";
import * as chat_models_minimax from "langchain/chat_models/minimax";
import * as chat_models_azure_ml from "langchain/chat_models/azure_ml";
import * as chat_models_yandex from "langchain/chat_models/yandex";
import * as chat_models_fake from "langchain/chat_models/fake";
import * as schema from "langchain/schema";
Expand Down
2 changes: 2 additions & 0 deletions environment_tests/test-exports-esm/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import * as llms_base from "langchain/llms/base";
import * as llms_openai from "langchain/llms/openai";
import * as llms_ai21 from "langchain/llms/ai21";
import * as llms_aleph_alpha from "langchain/llms/aleph_alpha";
import * as llms_azure_ml from "langchain/llms/azure_ml";
import * as llms_cloudflare_workersai from "langchain/llms/cloudflare_workersai";
import * as llms_ollama from "langchain/llms/ollama";
import * as llms_fireworks from "langchain/llms/fireworks";
Expand Down Expand Up @@ -57,6 +58,7 @@ import * as chat_models_fireworks from "langchain/chat_models/fireworks";
import * as chat_models_baiduwenxin from "langchain/chat_models/baiduwenxin";
import * as chat_models_ollama from "langchain/chat_models/ollama";
import * as chat_models_minimax from "langchain/chat_models/minimax";
import * as chat_models_azure_ml from "langchain/chat_models/azure_ml";
import * as chat_models_yandex from "langchain/chat_models/yandex";
import * as chat_models_fake from "langchain/chat_models/fake";
import * as schema from "langchain/schema";
Expand Down
2 changes: 2 additions & 0 deletions environment_tests/test-exports-vercel/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export * from "langchain/llms/base";
export * from "langchain/llms/openai";
export * from "langchain/llms/ai21";
export * from "langchain/llms/aleph_alpha";
export * from "langchain/llms/azure_ml";
export * from "langchain/llms/cloudflare_workersai";
export * from "langchain/llms/ollama";
export * from "langchain/llms/fireworks";
Expand Down Expand Up @@ -57,6 +58,7 @@ export * from "langchain/chat_models/fireworks";
export * from "langchain/chat_models/baiduwenxin";
export * from "langchain/chat_models/ollama";
export * from "langchain/chat_models/minimax";
export * from "langchain/chat_models/azure_ml";
export * from "langchain/chat_models/yandex";
export * from "langchain/chat_models/fake";
export * from "langchain/schema";
Expand Down
2 changes: 2 additions & 0 deletions environment_tests/test-exports-vite/src/entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export * from "langchain/llms/base";
export * from "langchain/llms/openai";
export * from "langchain/llms/ai21";
export * from "langchain/llms/aleph_alpha";
export * from "langchain/llms/azure_ml";
export * from "langchain/llms/cloudflare_workersai";
export * from "langchain/llms/ollama";
export * from "langchain/llms/fireworks";
Expand Down Expand Up @@ -57,6 +58,7 @@ export * from "langchain/chat_models/fireworks";
export * from "langchain/chat_models/baiduwenxin";
export * from "langchain/chat_models/ollama";
export * from "langchain/chat_models/minimax";
export * from "langchain/chat_models/azure_ml";
export * from "langchain/chat_models/yandex";
export * from "langchain/chat_models/fake";
export * from "langchain/schema";
Expand Down
14 changes: 14 additions & 0 deletions examples/src/models/chat/chat_azure_ml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
AzureMLChatOnlineEndpoint,
LlamaContentFormatter,
} from "langchain/chat_models/azure_ml";

const model = new AzureMLChatOnlineEndpoint({
endpointUrl: "YOUR_ENDPOINT_URL", // Or set as process.env.AZURE_ML_ENDPOINTURL
endpointApiKey: "YOUR_ENDPOINT_API_KEY", // Or set as process.env.AZURE_ML_APIKEY
contentFormatter: new LlamaContentFormatter(), // Only LLAMA currently supported.
});

const res = model.invoke("Foo");

console.log({ res });
15 changes: 15 additions & 0 deletions examples/src/models/llm/azure_ml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
AzureMLOnlineEndpoint,
LlamaContentFormatter,
} from "langchain/llms/azure_ml";

const model = new AzureMLOnlineEndpoint({
endpointUrl: "YOUR_ENDPOINT_URL", // Or set as process.env.AZURE_ML_ENDPOINTURL
endpointApiKey: "YOUR_ENDPOINT_API_KEY", // Or set as process.env.AZURE_ML_APIKEY
deploymentName: "YOUR_MODEL_DEPLOYMENT_NAME", // Or set as process.env.AZURE_ML_NAME
contentFormatter: new LlamaContentFormatter(), // Or any of the other Models: GPT2ContentFormatter, HFContentFormatter, DollyContentFormatter
});

const res = model.invoke("Foo");

console.log({ res });
6 changes: 6 additions & 0 deletions langchain/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ llms/ai21.d.ts
llms/aleph_alpha.cjs
llms/aleph_alpha.js
llms/aleph_alpha.d.ts
llms/azure_ml.cjs
llms/azure_ml.js
llms/azure_ml.d.ts
llms/cloudflare_workersai.cjs
llms/cloudflare_workersai.js
llms/cloudflare_workersai.d.ts
Expand Down Expand Up @@ -550,6 +553,9 @@ chat_models/minimax.d.ts
chat_models/llama_cpp.cjs
chat_models/llama_cpp.js
chat_models/llama_cpp.d.ts
chat_models/azure_ml.cjs
chat_models/azure_ml.js
chat_models/azure_ml.d.ts
chat_models/yandex.cjs
chat_models/yandex.js
chat_models/yandex.d.ts
Expand Down
16 changes: 16 additions & 0 deletions langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
"llms/aleph_alpha.cjs",
"llms/aleph_alpha.js",
"llms/aleph_alpha.d.ts",
"llms/azure_ml.cjs",
"llms/azure_ml.js",
"llms/azure_ml.d.ts",
"llms/cloudflare_workersai.cjs",
"llms/cloudflare_workersai.js",
"llms/cloudflare_workersai.d.ts",
Expand Down Expand Up @@ -562,6 +565,9 @@
"chat_models/llama_cpp.cjs",
"chat_models/llama_cpp.js",
"chat_models/llama_cpp.d.ts",
"chat_models/azure_ml.cjs",
"chat_models/azure_ml.js",
"chat_models/azure_ml.d.ts",
"chat_models/yandex.cjs",
"chat_models/yandex.js",
"chat_models/yandex.d.ts",
Expand Down Expand Up @@ -1504,6 +1510,11 @@
"import": "./llms/aleph_alpha.js",
"require": "./llms/aleph_alpha.cjs"
},
"./llms/azure_ml": {
"types": "./llms/azure_ml.d.ts",
"import": "./llms/azure_ml.js",
"require": "./llms/azure_ml.cjs"
},
"./llms/cloudflare_workersai": {
"types": "./llms/cloudflare_workersai.d.ts",
"import": "./llms/cloudflare_workersai.js",
Expand Down Expand Up @@ -2134,6 +2145,11 @@
"import": "./chat_models/llama_cpp.js",
"require": "./chat_models/llama_cpp.cjs"
},
"./chat_models/azure_ml": {
"types": "./chat_models/azure_ml.d.ts",
"import": "./chat_models/azure_ml.js",
"require": "./chat_models/azure_ml.cjs"
},
"./chat_models/yandex": {
"types": "./chat_models/yandex.d.ts",
"import": "./chat_models/yandex.js",
Expand Down
2 changes: 2 additions & 0 deletions langchain/scripts/create-entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const entrypoints = {
"llms/openai": "llms/openai",
"llms/ai21": "llms/ai21",
"llms/aleph_alpha": "llms/aleph_alpha",
"llms/azure_ml": "llms/azure_ml",
"llms/cloudflare_workersai": "llms/cloudflare_workersai",
"llms/cohere": "llms/cohere",
"llms/hf": "llms/hf",
Expand Down Expand Up @@ -215,6 +216,7 @@ const entrypoints = {
"chat_models/ollama": "chat_models/ollama",
"chat_models/minimax": "chat_models/minimax",
"chat_models/llama_cpp": "chat_models/llama_cpp",
"chat_models/azure_ml": "chat_models/azure_ml",
"chat_models/yandex": "chat_models/yandex",
"chat_models/fake": "chat_models/fake",
// schema
Expand Down
Loading
Loading