@langchain/together-ai 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,61 @@
1
+ import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings";
2
+
3
+ //#region src/embeddings.d.ts
4
+ interface TogetherAIEmbeddingsParams extends EmbeddingsParams {
5
+ /**
6
+ * The API key to use for the Together AI API.
7
+ * @default {process.env.TOGETHER_AI_API_KEY}
8
+ */
9
+ apiKey?: string;
10
+ /**
11
+ * Model name to use.
12
+ * Alias for `model`.
13
+ * @default {"togethercomputer/m2-bert-80M-8k-retrieval"}
14
+ */
15
+ modelName?: string;
16
+ /**
17
+ * Model name to use.
18
+ * @default {"togethercomputer/m2-bert-80M-8k-retrieval"}
19
+ */
20
+ model?: string;
21
+ /**
22
+ * Timeout to use when making requests to Together AI.
23
+ */
24
+ timeout?: number;
25
+ /**
26
+ * The maximum number of documents to embed in a single logical batch.
27
+ * @default {512}
28
+ */
29
+ batchSize?: number;
30
+ /**
31
+ * Whether to strip new lines from the input text.
32
+ * @default {false}
33
+ */
34
+ stripNewLines?: boolean;
35
+ }
36
+ /**
37
+ * Class for generating embeddings using the Together AI embeddings API.
38
+ */
39
+ declare class TogetherAIEmbeddings extends Embeddings implements TogetherAIEmbeddingsParams {
40
+ lc_serializable: boolean;
41
+ lc_namespace: string[];
42
+ modelName: string;
43
+ model: string;
44
+ apiKey: string;
45
+ batchSize: number;
46
+ stripNewLines: boolean;
47
+ timeout?: number;
48
+ private embeddingsAPIUrl;
49
+ get lc_secrets(): {
50
+ [key: string]: string;
51
+ } | undefined;
52
+ constructor(fields?: Partial<TogetherAIEmbeddingsParams>);
53
+ private constructHeaders;
54
+ private constructBody;
55
+ embedDocuments(texts: string[]): Promise<number[][]>;
56
+ embedQuery(text: string): Promise<number[]>;
57
+ private embeddingWithRetry;
58
+ }
59
+ //#endregion
60
+ export { TogetherAIEmbeddings, TogetherAIEmbeddingsParams };
61
+ //# sourceMappingURL=embeddings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embeddings.d.ts","names":[],"sources":["../src/embeddings.ts"],"mappings":";;;UAIiB,0BAAA,SAAmC,gBAAA;;AAApD;;;EAKE,MAAA;EALkD;;;;;EAWlD,SAAA;EAmBA;;;AAiBF;EA/BE,KAAA;;;;EAIA,OAAA;EAuGgC;;;;EAlGhC,SAAA;EAuBQ;;;;EAlBR,aAAA;AAAA;;;;cAiBW,oBAAA,SACH,UAAA,YACG,0BAAA;EAEX,eAAA;EAEA,YAAA;EAEA,SAAA;EAEA,KAAA;EAEA,MAAA;EAEA,SAAA;EAEA,aAAA;EAEA,OAAA;EAAA,QAEQ,gBAAA;EAAA,IAEJ,UAAA,CAAA;IAAA,CAAiB,GAAA;EAAA;EAMrB,WAAA,CAAY,MAAA,GAAS,OAAA,CAAQ,0BAAA;EAAA,QAiBrB,gBAAA;EAAA,QAQA,aAAA;EAOF,cAAA,CAAe,KAAA,aAAkB,OAAA;EAgBjC,UAAA,CAAW,IAAA,WAAe,OAAA;EAAA,QAOlB,kBAAA;AAAA"}
@@ -0,0 +1,80 @@
1
+ import { getEnvironmentVariable } from "@langchain/core/utils/env";
2
+ import { Embeddings } from "@langchain/core/embeddings";
3
+ import { chunkArray } from "@langchain/core/utils/chunk_array";
4
+ //#region src/embeddings.ts
5
+ /**
6
+ * Class for generating embeddings using the Together AI embeddings API.
7
+ */
8
+ var TogetherAIEmbeddings = class extends Embeddings {
9
+ lc_serializable = true;
10
+ lc_namespace = [
11
+ "langchain",
12
+ "embeddings",
13
+ "together_ai"
14
+ ];
15
+ modelName = "togethercomputer/m2-bert-80M-8k-retrieval";
16
+ model = "togethercomputer/m2-bert-80M-8k-retrieval";
17
+ apiKey;
18
+ batchSize = 512;
19
+ stripNewLines = false;
20
+ timeout;
21
+ embeddingsAPIUrl = "https://api.together.xyz/v1/embeddings";
22
+ get lc_secrets() {
23
+ return { apiKey: "TOGETHER_AI_API_KEY" };
24
+ }
25
+ constructor(fields) {
26
+ super(fields ?? {});
27
+ const apiKey = fields?.apiKey ?? getEnvironmentVariable("TOGETHER_AI_API_KEY");
28
+ if (!apiKey) throw new Error("TOGETHER_AI_API_KEY not found.");
29
+ this.apiKey = apiKey;
30
+ this.modelName = fields?.model ?? fields?.modelName ?? this.model;
31
+ this.model = this.modelName;
32
+ this.timeout = fields?.timeout;
33
+ this.batchSize = fields?.batchSize ?? this.batchSize;
34
+ this.stripNewLines = fields?.stripNewLines ?? this.stripNewLines;
35
+ }
36
+ constructHeaders() {
37
+ return {
38
+ accept: "application/json",
39
+ "content-type": "application/json",
40
+ Authorization: `Bearer ${this.apiKey}`
41
+ };
42
+ }
43
+ constructBody(input) {
44
+ return {
45
+ model: this.model,
46
+ input
47
+ };
48
+ }
49
+ async embedDocuments(texts) {
50
+ const batches = chunkArray(this.stripNewLines ? texts.map((t) => t.replace(/\n/g, " ")) : texts, this.batchSize);
51
+ let batchResponses = [];
52
+ for await (const batch of batches) {
53
+ const batchRequests = batch.map((item) => this.embeddingWithRetry(item));
54
+ const response = await Promise.all(batchRequests);
55
+ batchResponses = batchResponses.concat(response);
56
+ }
57
+ return batchResponses.map((response) => response.data[0].embedding);
58
+ }
59
+ async embedQuery(text) {
60
+ const { data } = await this.embeddingWithRetry(this.stripNewLines ? text.replace(/\n/g, " ") : text);
61
+ return data[0].embedding;
62
+ }
63
+ async embeddingWithRetry(input) {
64
+ const body = JSON.stringify(this.constructBody(input));
65
+ const headers = this.constructHeaders();
66
+ return this.caller.call(async () => {
67
+ const fetchResponse = await fetch(this.embeddingsAPIUrl, {
68
+ method: "POST",
69
+ headers,
70
+ body
71
+ });
72
+ if (fetchResponse.status === 200) return fetchResponse.json();
73
+ throw new Error(`Error getting prompt completion from Together AI. ${JSON.stringify(await fetchResponse.json(), null, 2)}`);
74
+ });
75
+ }
76
+ };
77
+ //#endregion
78
+ export { TogetherAIEmbeddings };
79
+
80
+ //# sourceMappingURL=embeddings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embeddings.js","names":[],"sources":["../src/embeddings.ts"],"sourcesContent":["import { Embeddings, type EmbeddingsParams } from \"@langchain/core/embeddings\";\nimport { chunkArray } from \"@langchain/core/utils/chunk_array\";\nimport { getEnvironmentVariable } from \"@langchain/core/utils/env\";\n\nexport interface TogetherAIEmbeddingsParams extends EmbeddingsParams {\n /**\n * The API key to use for the Together AI API.\n * @default {process.env.TOGETHER_AI_API_KEY}\n */\n apiKey?: string;\n /**\n * Model name to use.\n * Alias for `model`.\n * @default {\"togethercomputer/m2-bert-80M-8k-retrieval\"}\n */\n modelName?: string;\n /**\n * Model name to use.\n * @default {\"togethercomputer/m2-bert-80M-8k-retrieval\"}\n */\n model?: string;\n /**\n * Timeout to use when making requests to Together AI.\n */\n timeout?: number;\n /**\n * The maximum number of documents to embed in a single logical batch.\n * @default {512}\n */\n batchSize?: number;\n /**\n * Whether to strip new lines from the input text.\n * @default {false}\n */\n stripNewLines?: boolean;\n}\n\ninterface TogetherAIEmbeddingsResult {\n object: string;\n data: Array<{\n object: \"embedding\";\n embedding: number[];\n index: number;\n }>;\n model: string;\n request_id: string;\n}\n\n/**\n * Class for generating embeddings using the Together AI embeddings API.\n */\nexport class TogetherAIEmbeddings\n extends Embeddings\n implements TogetherAIEmbeddingsParams\n{\n lc_serializable = true;\n\n lc_namespace = [\"langchain\", \"embeddings\", \"together_ai\"];\n\n modelName = \"togethercomputer/m2-bert-80M-8k-retrieval\";\n\n model = \"togethercomputer/m2-bert-80M-8k-retrieval\";\n\n apiKey: string;\n\n batchSize = 512;\n\n stripNewLines = false;\n\n timeout?: number;\n\n private embeddingsAPIUrl = \"https://api.together.xyz/v1/embeddings\";\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n apiKey: \"TOGETHER_AI_API_KEY\",\n };\n }\n\n constructor(fields?: Partial<TogetherAIEmbeddingsParams>) {\n super(fields ?? {});\n\n const apiKey =\n fields?.apiKey ?? getEnvironmentVariable(\"TOGETHER_AI_API_KEY\");\n if (!apiKey) {\n throw new Error(\"TOGETHER_AI_API_KEY not found.\");\n }\n\n this.apiKey = apiKey;\n this.modelName = fields?.model ?? fields?.modelName ?? this.model;\n this.model = this.modelName;\n this.timeout = fields?.timeout;\n this.batchSize = fields?.batchSize ?? this.batchSize;\n this.stripNewLines = fields?.stripNewLines ?? this.stripNewLines;\n }\n\n private constructHeaders() {\n return {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n Authorization: `Bearer ${this.apiKey}`,\n };\n }\n\n private constructBody(input: string) {\n return {\n model: this.model,\n input,\n };\n }\n\n async embedDocuments(texts: string[]): Promise<number[][]> {\n const batches = chunkArray(\n this.stripNewLines ? texts.map((t) => t.replace(/\\n/g, \" \")) : texts,\n this.batchSize\n );\n\n let batchResponses: TogetherAIEmbeddingsResult[] = [];\n for await (const batch of batches) {\n const batchRequests = batch.map((item) => this.embeddingWithRetry(item));\n const response = await Promise.all(batchRequests);\n batchResponses = batchResponses.concat(response);\n }\n\n return batchResponses.map((response) => response.data[0].embedding);\n }\n\n async embedQuery(text: string): Promise<number[]> {\n const { data } = await this.embeddingWithRetry(\n this.stripNewLines ? text.replace(/\\n/g, \" \") : text\n );\n return data[0].embedding;\n }\n\n private async embeddingWithRetry(\n input: string\n ): Promise<TogetherAIEmbeddingsResult> {\n const body = JSON.stringify(this.constructBody(input));\n const headers = this.constructHeaders();\n\n return this.caller.call(async () => {\n const fetchResponse = await fetch(this.embeddingsAPIUrl, {\n method: \"POST\",\n headers,\n body,\n });\n\n if (fetchResponse.status === 200) {\n return fetchResponse.json();\n }\n throw new Error(\n `Error getting prompt completion from Together AI. ${JSON.stringify(\n await fetchResponse.json(),\n null,\n 2\n )}`\n );\n });\n }\n}\n"],"mappings":";;;;;;;AAmDA,IAAa,uBAAb,cACU,WAEV;CACE,kBAAkB;CAElB,eAAe;EAAC;EAAa;EAAc;EAAc;CAEzD,YAAY;CAEZ,QAAQ;CAER;CAEA,YAAY;CAEZ,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C,SAAO,KAAK,OAAO,KAAK,YAAY;GAClC,MAAM,gBAAgB,MAAM,MAAM,KAAK,kBAAkB;IACvD,QAAQ;IACR;IACA;IACD,CAAC;AAEF,OAAI,cAAc,WAAW,IAC3B,QAAO,cAAc,MAAM;AAE7B,SAAM,IAAI,MACR,qDAAqD,KAAK,UACxD,MAAM,cAAc,MAAM,EAC1B,MACA,EACD,GACF;IACD"}
package/dist/index.cjs ADDED
@@ -0,0 +1,7 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_chat_models = require("./chat_models.cjs");
3
+ const require_embeddings = require("./embeddings.cjs");
4
+ const require_llms = require("./llms.cjs");
5
+ exports.ChatTogetherAI = require_chat_models.ChatTogetherAI;
6
+ exports.TogetherAI = require_llms.TogetherAI;
7
+ exports.TogetherAIEmbeddings = require_embeddings.TogetherAIEmbeddings;
@@ -0,0 +1,4 @@
1
+ import { ChatTogetherAI, ChatTogetherAICallOptions, ChatTogetherAIInput } from "./chat_models.cjs";
2
+ import { TogetherAIEmbeddings, TogetherAIEmbeddingsParams } from "./embeddings.cjs";
3
+ import { TogetherAI, TogetherAICallOptions, TogetherAIInputs } from "./llms.cjs";
4
+ export { ChatTogetherAI, ChatTogetherAICallOptions, ChatTogetherAIInput, TogetherAI, TogetherAICallOptions, TogetherAIEmbeddings, TogetherAIEmbeddingsParams, TogetherAIInputs };
@@ -0,0 +1,4 @@
1
+ import { ChatTogetherAI, ChatTogetherAICallOptions, ChatTogetherAIInput } from "./chat_models.js";
2
+ import { TogetherAIEmbeddings, TogetherAIEmbeddingsParams } from "./embeddings.js";
3
+ import { TogetherAI, TogetherAICallOptions, TogetherAIInputs } from "./llms.js";
4
+ export { ChatTogetherAI, ChatTogetherAICallOptions, ChatTogetherAIInput, TogetherAI, TogetherAICallOptions, TogetherAIEmbeddings, TogetherAIEmbeddingsParams, TogetherAIInputs };
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { ChatTogetherAI } from "./chat_models.js";
2
+ import { TogetherAIEmbeddings } from "./embeddings.js";
3
+ import { TogetherAI } from "./llms.js";
4
+ export { ChatTogetherAI, TogetherAI, TogetherAIEmbeddings };
package/dist/llms.cjs ADDED
@@ -0,0 +1,128 @@
1
+ const require_event_source_parse = require("./utils/event_source_parse.cjs");
2
+ let _langchain_core_utils_env = require("@langchain/core/utils/env");
3
+ let _langchain_core_language_models_llms = require("@langchain/core/language_models/llms");
4
+ let _langchain_core_outputs = require("@langchain/core/outputs");
5
+ //#region src/llms.ts
6
+ var TogetherAI = class extends _langchain_core_language_models_llms.LLM {
7
+ lc_serializable = true;
8
+ lc_namespace = [
9
+ "langchain",
10
+ "llms",
11
+ "together_ai"
12
+ ];
13
+ static inputs;
14
+ temperature = .7;
15
+ topP = .7;
16
+ topK = 50;
17
+ modelName;
18
+ model;
19
+ streaming = false;
20
+ repetitionPenalty = 1;
21
+ logprobs;
22
+ maxTokens;
23
+ safetyModel;
24
+ stop;
25
+ apiKey;
26
+ inferenceAPIUrl = "https://api.together.xyz/inference";
27
+ static lc_name() {
28
+ return "TogetherAI";
29
+ }
30
+ get lc_secrets() {
31
+ return { apiKey: "TOGETHER_AI_API_KEY" };
32
+ }
33
+ get lc_aliases() {
34
+ return { apiKey: "together_ai_api_key" };
35
+ }
36
+ isChatModel(modelName) {
37
+ return [
38
+ /instruct/i,
39
+ /chat/i,
40
+ /vision/i,
41
+ /turbo/i
42
+ ].some((pattern) => pattern.test(modelName));
43
+ }
44
+ constructor(inputs) {
45
+ super(inputs);
46
+ this._addVersion("@langchain/together-ai", "0.0.1");
47
+ const apiKey = inputs.apiKey ?? (0, _langchain_core_utils_env.getEnvironmentVariable)("TOGETHER_AI_API_KEY");
48
+ if (!apiKey) throw new Error("TOGETHER_AI_API_KEY not found.");
49
+ if (!inputs.model && !inputs.modelName) throw new Error("Model name is required for TogetherAI.");
50
+ this.apiKey = apiKey;
51
+ this.temperature = inputs.temperature ?? this.temperature;
52
+ this.topK = inputs.topK ?? this.topK;
53
+ this.topP = inputs.topP ?? this.topP;
54
+ this.modelName = inputs.model ?? inputs.modelName ?? "";
55
+ this.model = this.modelName;
56
+ this.streaming = inputs.streaming ?? this.streaming;
57
+ this.repetitionPenalty = inputs.repetitionPenalty ?? this.repetitionPenalty;
58
+ this.logprobs = inputs.logprobs;
59
+ this.safetyModel = inputs.safetyModel;
60
+ this.maxTokens = inputs.maxTokens;
61
+ this.stop = inputs.stop;
62
+ if (this.isChatModel(this.model)) console.warn(`Warning: Model '${this.model}' appears to be a chat/instruct model. Consider using ChatTogetherAI from @langchain/together-ai instead.`);
63
+ }
64
+ _llmType() {
65
+ return "together_ai";
66
+ }
67
+ constructHeaders() {
68
+ return {
69
+ accept: "application/json",
70
+ "content-type": "application/json",
71
+ Authorization: `Bearer ${this.apiKey}`
72
+ };
73
+ }
74
+ constructBody(prompt, options) {
75
+ return {
76
+ model: options?.model ?? options?.modelName ?? this.model,
77
+ prompt,
78
+ temperature: options?.temperature ?? this.temperature,
79
+ top_k: options?.topK ?? this.topK,
80
+ top_p: options?.topP ?? this.topP,
81
+ repetition_penalty: options?.repetitionPenalty ?? this.repetitionPenalty,
82
+ logprobs: options?.logprobs ?? this.logprobs,
83
+ stream_tokens: this.streaming,
84
+ safety_model: options?.safetyModel ?? this.safetyModel,
85
+ max_tokens: options?.maxTokens ?? this.maxTokens,
86
+ stop: options?.stop ?? this.stop
87
+ };
88
+ }
89
+ async completionWithRetry(prompt, options) {
90
+ return this.caller.call(async () => {
91
+ const fetchResponse = await fetch(this.inferenceAPIUrl, {
92
+ method: "POST",
93
+ headers: { ...this.constructHeaders() },
94
+ body: JSON.stringify(this.constructBody(prompt, options))
95
+ });
96
+ if (fetchResponse.status === 200) return fetchResponse.json();
97
+ const errorResponse = await fetchResponse.json();
98
+ throw new Error(`Error getting prompt completion from Together AI. ${JSON.stringify(errorResponse, null, 2)}`);
99
+ });
100
+ }
101
+ async _call(prompt, options) {
102
+ const response = await this.completionWithRetry(prompt, options);
103
+ if (!response.output && !response.choices) throw new Error(`Unexpected response format from Together AI. The model '${this.model}' may require the ChatTogetherAI class instead of TogetherAI class. Response: ${JSON.stringify(response, null, 2)}`);
104
+ if (response.output) return response.output.choices?.[0]?.text ?? "";
105
+ return response.choices?.[0]?.text ?? "";
106
+ }
107
+ async *_streamResponseChunks(prompt, options, runManager) {
108
+ const fetchResponse = await fetch(this.inferenceAPIUrl, {
109
+ method: "POST",
110
+ headers: { ...this.constructHeaders() },
111
+ body: JSON.stringify(this.constructBody(prompt, options))
112
+ });
113
+ if (fetchResponse.status !== 200 || !fetchResponse.body) {
114
+ const errorResponse = await fetchResponse.json();
115
+ throw new Error(`Error getting prompt completion from Together AI. ${JSON.stringify(errorResponse, null, 2)}`);
116
+ }
117
+ const stream = require_event_source_parse.convertEventStreamToIterableReadableDataStream(fetchResponse.body);
118
+ for await (const chunk of stream) if (chunk !== "[DONE]") {
119
+ const generationChunk = new _langchain_core_outputs.GenerationChunk({ text: JSON.parse(chunk).choices[0].text ?? "" });
120
+ yield generationChunk;
121
+ runManager?.handleLLMNewToken(generationChunk.text ?? "");
122
+ }
123
+ }
124
+ };
125
+ //#endregion
126
+ exports.TogetherAI = TogetherAI;
127
+
128
+ //# sourceMappingURL=llms.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llms.cjs","names":["LLM","convertEventStreamToIterableReadableDataStream","GenerationChunk"],"sources":["../src/llms.ts"],"sourcesContent":["import { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport {\n LLM,\n type BaseLLMCallOptions,\n type BaseLLMParams,\n} from \"@langchain/core/language_models/llms\";\nimport { GenerationChunk } from \"@langchain/core/outputs\";\nimport { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { convertEventStreamToIterableReadableDataStream } from \"./utils/event_source_parse.js\";\n\ninterface TogetherAIInferenceResult {\n object: string;\n status: string;\n prompt: Array<string>;\n model: string;\n model_owner: string;\n tags: object;\n num_returns: number;\n args: {\n model: string;\n prompt: string;\n temperature: number;\n top_p: number;\n top_k: number;\n max_tokens: number;\n stop: string[];\n };\n subjobs: unknown[];\n output?: {\n choices: Array<{\n finish_reason: string;\n index: number;\n text: string;\n }>;\n raw_compute_time: number;\n result_type: string;\n };\n choices?: Array<{\n finish_reason: string;\n index: number;\n text: string;\n }>;\n}\n\nexport interface TogetherAIInputs extends BaseLLMParams {\n /**\n * The API key to use for the Together AI API.\n * @default {process.env.TOGETHER_AI_API_KEY}\n */\n apiKey?: string;\n /**\n * The name of the model to query.\n * Alias for `model`.\n */\n modelName?: string;\n /**\n * The name of the model to query.\n */\n model?: string;\n /**\n * A decimal number that determines the degree of randomness in the response.\n * @default {0.7}\n */\n temperature?: number;\n /**\n * Whether or not to stream tokens as they are generated.\n * @default {false}\n */\n streaming?: boolean;\n /**\n * Nucleus sampling threshold.\n * @default {0.7}\n */\n topP?: number;\n /**\n * Limit the number of token candidates considered at each step.\n * @default {50}\n */\n topK?: number;\n /**\n * A number that controls repetition.\n * @default {1}\n */\n repetitionPenalty?: number;\n /**\n * An integer that specifies how many top token log probabilities are included.\n */\n logprobs?: number;\n /**\n * Run an LLM-based safeguard model on top of any model.\n */\n safetyModel?: string;\n /**\n * Limit the number of generated tokens.\n */\n maxTokens?: number;\n /**\n * A list of tokens at which the generation should stop.\n */\n stop?: string[];\n}\n\nexport interface TogetherAICallOptions\n extends\n BaseLLMCallOptions,\n Pick<\n TogetherAIInputs,\n | \"modelName\"\n | \"model\"\n | \"temperature\"\n | \"topP\"\n | \"topK\"\n | \"repetitionPenalty\"\n | \"logprobs\"\n | \"safetyModel\"\n | \"maxTokens\"\n | \"stop\"\n > {}\n\nexport class TogetherAI extends LLM<TogetherAICallOptions> {\n lc_serializable = true;\n\n lc_namespace = [\"langchain\", \"llms\", \"together_ai\"];\n\n static inputs: TogetherAIInputs;\n\n temperature = 0.7;\n\n topP = 0.7;\n\n topK = 50;\n\n modelName: string;\n\n model: string;\n\n streaming = false;\n\n repetitionPenalty = 1;\n\n logprobs?: number;\n\n maxTokens?: number;\n\n safetyModel?: string;\n\n stop?: string[];\n\n private apiKey: string;\n\n private inferenceAPIUrl = \"https://api.together.xyz/inference\";\n\n static lc_name() {\n return \"TogetherAI\";\n }\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n apiKey: \"TOGETHER_AI_API_KEY\",\n };\n }\n\n get lc_aliases(): { [key: string]: string } | undefined {\n return {\n apiKey: \"together_ai_api_key\",\n };\n }\n\n private isChatModel(modelName: string): boolean {\n const chatModelPatterns = [/instruct/i, /chat/i, /vision/i, /turbo/i];\n return chatModelPatterns.some((pattern) => pattern.test(modelName));\n }\n\n constructor(inputs: TogetherAIInputs) {\n super(inputs);\n this._addVersion(\"@langchain/together-ai\", __PKG_VERSION__);\n const apiKey =\n inputs.apiKey ?? getEnvironmentVariable(\"TOGETHER_AI_API_KEY\");\n if (!apiKey) {\n throw new Error(\"TOGETHER_AI_API_KEY not found.\");\n }\n if (!inputs.model && !inputs.modelName) {\n throw new Error(\"Model name is required for TogetherAI.\");\n }\n this.apiKey = apiKey;\n this.temperature = inputs.temperature ?? this.temperature;\n this.topK = inputs.topK ?? this.topK;\n this.topP = inputs.topP ?? this.topP;\n this.modelName = inputs.model ?? inputs.modelName ?? \"\";\n this.model = this.modelName;\n this.streaming = inputs.streaming ?? this.streaming;\n this.repetitionPenalty = inputs.repetitionPenalty ?? this.repetitionPenalty;\n this.logprobs = inputs.logprobs;\n this.safetyModel = inputs.safetyModel;\n this.maxTokens = inputs.maxTokens;\n this.stop = inputs.stop;\n\n if (this.isChatModel(this.model)) {\n console.warn(\n `Warning: Model '${this.model}' appears to be a chat/instruct model. ` +\n \"Consider using ChatTogetherAI from @langchain/together-ai instead.\"\n );\n }\n }\n\n _llmType() {\n return \"together_ai\";\n }\n\n private constructHeaders() {\n return {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n Authorization: `Bearer ${this.apiKey}`,\n };\n }\n\n private constructBody(prompt: string, options?: this[\"ParsedCallOptions\"]) {\n return {\n model: options?.model ?? options?.modelName ?? this.model,\n prompt,\n temperature: options?.temperature ?? this.temperature,\n top_k: options?.topK ?? this.topK,\n top_p: options?.topP ?? this.topP,\n repetition_penalty: options?.repetitionPenalty ?? this.repetitionPenalty,\n logprobs: options?.logprobs ?? this.logprobs,\n stream_tokens: this.streaming,\n safety_model: options?.safetyModel ?? this.safetyModel,\n max_tokens: options?.maxTokens ?? this.maxTokens,\n stop: options?.stop ?? this.stop,\n };\n }\n\n async completionWithRetry(\n prompt: string,\n options?: this[\"ParsedCallOptions\"]\n ) {\n return this.caller.call(async () => {\n const fetchResponse = await fetch(this.inferenceAPIUrl, {\n method: \"POST\",\n headers: {\n ...this.constructHeaders(),\n },\n body: JSON.stringify(this.constructBody(prompt, options)),\n });\n if (fetchResponse.status === 200) {\n return fetchResponse.json();\n }\n const errorResponse = await fetchResponse.json();\n throw new Error(\n `Error getting prompt completion from Together AI. ${JSON.stringify(\n errorResponse,\n null,\n 2\n )}`\n );\n });\n }\n\n async _call(\n prompt: string,\n options?: this[\"ParsedCallOptions\"]\n ): Promise<string> {\n const response: TogetherAIInferenceResult = await this.completionWithRetry(\n prompt,\n options\n );\n\n if (!response.output && !response.choices) {\n throw new Error(\n `Unexpected response format from Together AI. The model '${this.model}' may require the ChatTogetherAI class instead of TogetherAI class. ` +\n `Response: ${JSON.stringify(response, null, 2)}`\n );\n }\n\n if (response.output) {\n return response.output.choices?.[0]?.text ?? \"\";\n }\n return response.choices?.[0]?.text ?? \"\";\n }\n\n async *_streamResponseChunks(\n prompt: string,\n options: this[\"ParsedCallOptions\"],\n runManager?: CallbackManagerForLLMRun\n ): AsyncGenerator<GenerationChunk> {\n const fetchResponse = await fetch(this.inferenceAPIUrl, {\n method: \"POST\",\n headers: {\n ...this.constructHeaders(),\n },\n body: JSON.stringify(this.constructBody(prompt, options)),\n });\n\n if (fetchResponse.status !== 200 || !fetchResponse.body) {\n const errorResponse = await fetchResponse.json();\n throw new Error(\n `Error getting prompt completion from Together AI. ${JSON.stringify(\n errorResponse,\n null,\n 2\n )}`\n );\n }\n const stream = convertEventStreamToIterableReadableDataStream(\n fetchResponse.body\n );\n for await (const chunk of stream) {\n if (chunk !== \"[DONE]\") {\n const parsedChunk = JSON.parse(chunk);\n const generationChunk = new GenerationChunk({\n text: parsedChunk.choices[0].text ?? \"\",\n });\n yield generationChunk;\n // eslint-disable-next-line no-void\n void runManager?.handleLLMNewToken(generationChunk.text ?? \"\");\n }\n }\n }\n}\n"],"mappings":";;;;;AAuHA,IAAa,aAAb,cAAgCA,qCAAAA,IAA2B;CACzD,kBAAkB;CAElB,eAAe;EAAC;EAAa;EAAQ;EAAc;CAEnD,OAAO;CAEP,cAAc;CAEd,OAAO;CAEP,OAAO;CAEP;CAEA;CAEA,YAAY;CAEZ,oBAAoB;CAEpB;CAEA;CAEA;CAEA;CAEA;CAEA,kBAA0B;CAE1B,OAAO,UAAU;AACf,SAAO;;CAGT,IAAI,aAAoD;AACtD,SAAO,EACL,QAAQ,uBACT;;CAGH,IAAI,aAAoD;AACtD,SAAO,EACL,QAAQ,uBACT;;CAGH,YAAoB,WAA4B;AAE9C,SAD0B;GAAC;GAAa;GAAS;GAAW;GAAS,CAC5C,MAAM,YAAY,QAAQ,KAAK,UAAU,CAAC;;CAGrE,YAAY,QAA0B;AACpC,QAAM,OAAO;AACb,OAAK,YAAY,0BAAA,QAA0C;EAC3D,MAAM,SACJ,OAAO,WAAA,GAAA,0BAAA,wBAAiC,sBAAsB;AAChE,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,iCAAiC;AAEnD,MAAI,CAAC,OAAO,SAAS,CAAC,OAAO,UAC3B,OAAM,IAAI,MAAM,yCAAyC;AAE3D,OAAK,SAAS;AACd,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,OAAO,OAAO,QAAQ,KAAK;AAChC,OAAK,OAAO,OAAO,QAAQ,KAAK;AAChC,OAAK,YAAY,OAAO,SAAS,OAAO,aAAa;AACrD,OAAK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,CAAC,SAAS,UAAU,CAAC,SAAS,QAChC,OAAM,IAAI,MACR,2DAA2D,KAAK,MAAM,gFACvD,KAAK,UAAU,UAAU,MAAM,EAAE,GACjD;AAGH,MAAI,SAAS,OACX,QAAO,SAAS,OAAO,UAAU,IAAI,QAAQ;AAE/C,SAAO,SAAS,UAAU,IAAI,QAAQ;;CAGxC,OAAO,sBACL,QACA,SACA,YACiC;EACjC,MAAM,gBAAgB,MAAM,MAAM,KAAK,iBAAiB;GACtD,QAAQ;GACR,SAAS,EACP,GAAG,KAAK,kBAAkB,EAC3B;GACD,MAAM,KAAK,UAAU,KAAK,cAAc,QAAQ,QAAQ,CAAC;GAC1D,CAAC;AAEF,MAAI,cAAc,WAAW,OAAO,CAAC,cAAc,MAAM;GACvD,MAAM,gBAAgB,MAAM,cAAc,MAAM;AAChD,SAAM,IAAI,MACR,qDAAqD,KAAK,UACxD,eACA,MACA,EACD,GACF;;EAEH,MAAM,SAASC,2BAAAA,+CACb,cAAc,KACf;AACD,aAAW,MAAM,SAAS,OACxB,KAAI,UAAU,UAAU;GAEtB,MAAM,kBAAkB,IAAIC,wBAAAA,gBAAgB,EAC1C,MAFkB,KAAK,MAAM,MAAM,CAEjB,QAAQ,GAAG,QAAQ,IACtC,CAAC;AACF,SAAM;AAED,eAAY,kBAAkB,gBAAgB,QAAQ,GAAG"}
@@ -0,0 +1,99 @@
1
+ import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
2
+ import { BaseLLMCallOptions, BaseLLMParams, LLM } from "@langchain/core/language_models/llms";
3
+ import { GenerationChunk } from "@langchain/core/outputs";
4
+
5
+ //#region src/llms.d.ts
6
+ interface TogetherAIInputs extends BaseLLMParams {
7
+ /**
8
+ * The API key to use for the Together AI API.
9
+ * @default {process.env.TOGETHER_AI_API_KEY}
10
+ */
11
+ apiKey?: string;
12
+ /**
13
+ * The name of the model to query.
14
+ * Alias for `model`.
15
+ */
16
+ modelName?: string;
17
+ /**
18
+ * The name of the model to query.
19
+ */
20
+ model?: string;
21
+ /**
22
+ * A decimal number that determines the degree of randomness in the response.
23
+ * @default {0.7}
24
+ */
25
+ temperature?: number;
26
+ /**
27
+ * Whether or not to stream tokens as they are generated.
28
+ * @default {false}
29
+ */
30
+ streaming?: boolean;
31
+ /**
32
+ * Nucleus sampling threshold.
33
+ * @default {0.7}
34
+ */
35
+ topP?: number;
36
+ /**
37
+ * Limit the number of token candidates considered at each step.
38
+ * @default {50}
39
+ */
40
+ topK?: number;
41
+ /**
42
+ * A number that controls repetition.
43
+ * @default {1}
44
+ */
45
+ repetitionPenalty?: number;
46
+ /**
47
+ * An integer that specifies how many top token log probabilities are included.
48
+ */
49
+ logprobs?: number;
50
+ /**
51
+ * Run an LLM-based safeguard model on top of any model.
52
+ */
53
+ safetyModel?: string;
54
+ /**
55
+ * Limit the number of generated tokens.
56
+ */
57
+ maxTokens?: number;
58
+ /**
59
+ * A list of tokens at which the generation should stop.
60
+ */
61
+ stop?: string[];
62
+ }
63
+ interface TogetherAICallOptions extends BaseLLMCallOptions, Pick<TogetherAIInputs, "modelName" | "model" | "temperature" | "topP" | "topK" | "repetitionPenalty" | "logprobs" | "safetyModel" | "maxTokens" | "stop"> {}
64
+ declare class TogetherAI extends LLM<TogetherAICallOptions> {
65
+ lc_serializable: boolean;
66
+ lc_namespace: string[];
67
+ static inputs: TogetherAIInputs;
68
+ temperature: number;
69
+ topP: number;
70
+ topK: number;
71
+ modelName: string;
72
+ model: string;
73
+ streaming: boolean;
74
+ repetitionPenalty: number;
75
+ logprobs?: number;
76
+ maxTokens?: number;
77
+ safetyModel?: string;
78
+ stop?: string[];
79
+ private apiKey;
80
+ private inferenceAPIUrl;
81
+ static lc_name(): string;
82
+ get lc_secrets(): {
83
+ [key: string]: string;
84
+ } | undefined;
85
+ get lc_aliases(): {
86
+ [key: string]: string;
87
+ } | undefined;
88
+ private isChatModel;
89
+ constructor(inputs: TogetherAIInputs);
90
+ _llmType(): string;
91
+ private constructHeaders;
92
+ private constructBody;
93
+ completionWithRetry(prompt: string, options?: this["ParsedCallOptions"]): Promise<any>;
94
+ _call(prompt: string, options?: this["ParsedCallOptions"]): Promise<string>;
95
+ _streamResponseChunks(prompt: string, options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<GenerationChunk>;
96
+ }
97
+ //#endregion
98
+ export { TogetherAI, TogetherAICallOptions, TogetherAIInputs };
99
+ //# sourceMappingURL=llms.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llms.d.cts","names":[],"sources":["../src/llms.ts"],"mappings":";;;;;UA4CiB,gBAAA,SAAyB,aAAA;;AAA1C;;;EAKE,MAAA;EALwC;;;;EAUxC,SAAA;EAcA;;;EAVA,KAAA;EA6BA;;;;EAxBA,WAAA;EAoCI;AAGN;;;EAlCE,SAAA;EAoCE;;;;EA/BF,IAAA;EAgCE;;;;EA3BF,IAAA;EAyCsB;;;;EApCtB,iBAAA;EAwJqC;;;EApJrC,QAAA;EAsMG;;;EAlMH,WAAA;EA4B8B;;;EAxB9B,SAAA;EA6BO;;;EAzBP,IAAA;AAAA;AAAA,UAGe,qBAAA,SAEb,kBAAA,EACA,IAAA,CACE,gBAAA;AAAA,cAaO,UAAA,SAAmB,GAAA,CAAI,qBAAA;EAClC,eAAA;EAEA,YAAA;EAAA,OAEO,MAAA,EAAQ,gBAAA;EAEf,WAAA;EAEA,IAAA;EAEA,IAAA;EAEA,SAAA;EAEA,KAAA;EAEA,SAAA;EAEA,iBAAA;EAEA,QAAA;EAEA,SAAA;EAEA,WAAA;EAEA,IAAA;EAAA,QAEQ,MAAA;EAAA,QAEA,eAAA;EAAA,OAED,OAAA,CAAA;EAAA,IAIH,UAAA,CAAA;IAAA,CAAiB,GAAA;EAAA;EAAA,IAMjB,UAAA,CAAA;IAAA,CAAiB,GAAA;EAAA;EAAA,QAMb,WAAA;EAKR,WAAA,CAAY,MAAA,EAAQ,gBAAA;EAgCpB,QAAA,CAAA;EAAA,QAIQ,gBAAA;EAAA,QAQA,aAAA;EAgBF,mBAAA,CACJ,MAAA,UACA,OAAA,+BAAmC,OAAA;EAwB/B,KAAA,CACJ,MAAA,UACA,OAAA,+BACC,OAAA;EAmBI,qBAAA,CACL,MAAA,UACA,OAAA,6BACA,UAAA,GAAa,wBAAA,GACZ,cAAA,CAAe,eAAA;AAAA"}
package/dist/llms.d.ts ADDED
@@ -0,0 +1,99 @@
1
+ import { BaseLLMCallOptions, BaseLLMParams, LLM } from "@langchain/core/language_models/llms";
2
+ import { GenerationChunk } from "@langchain/core/outputs";
3
+ import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
4
+
5
+ //#region src/llms.d.ts
6
+ interface TogetherAIInputs extends BaseLLMParams {
7
+ /**
8
+ * The API key to use for the Together AI API.
9
+ * @default {process.env.TOGETHER_AI_API_KEY}
10
+ */
11
+ apiKey?: string;
12
+ /**
13
+ * The name of the model to query.
14
+ * Alias for `model`.
15
+ */
16
+ modelName?: string;
17
+ /**
18
+ * The name of the model to query.
19
+ */
20
+ model?: string;
21
+ /**
22
+ * A decimal number that determines the degree of randomness in the response.
23
+ * @default {0.7}
24
+ */
25
+ temperature?: number;
26
+ /**
27
+ * Whether or not to stream tokens as they are generated.
28
+ * @default {false}
29
+ */
30
+ streaming?: boolean;
31
+ /**
32
+ * Nucleus sampling threshold.
33
+ * @default {0.7}
34
+ */
35
+ topP?: number;
36
+ /**
37
+ * Limit the number of token candidates considered at each step.
38
+ * @default {50}
39
+ */
40
+ topK?: number;
41
+ /**
42
+ * A number that controls repetition.
43
+ * @default {1}
44
+ */
45
+ repetitionPenalty?: number;
46
+ /**
47
+ * An integer that specifies how many top token log probabilities are included.
48
+ */
49
+ logprobs?: number;
50
+ /**
51
+ * Run an LLM-based safeguard model on top of any model.
52
+ */
53
+ safetyModel?: string;
54
+ /**
55
+ * Limit the number of generated tokens.
56
+ */
57
+ maxTokens?: number;
58
+ /**
59
+ * A list of tokens at which the generation should stop.
60
+ */
61
+ stop?: string[];
62
+ }
63
+ interface TogetherAICallOptions extends BaseLLMCallOptions, Pick<TogetherAIInputs, "modelName" | "model" | "temperature" | "topP" | "topK" | "repetitionPenalty" | "logprobs" | "safetyModel" | "maxTokens" | "stop"> {}
64
+ declare class TogetherAI extends LLM<TogetherAICallOptions> {
65
+ lc_serializable: boolean;
66
+ lc_namespace: string[];
67
+ static inputs: TogetherAIInputs;
68
+ temperature: number;
69
+ topP: number;
70
+ topK: number;
71
+ modelName: string;
72
+ model: string;
73
+ streaming: boolean;
74
+ repetitionPenalty: number;
75
+ logprobs?: number;
76
+ maxTokens?: number;
77
+ safetyModel?: string;
78
+ stop?: string[];
79
+ private apiKey;
80
+ private inferenceAPIUrl;
81
+ static lc_name(): string;
82
+ get lc_secrets(): {
83
+ [key: string]: string;
84
+ } | undefined;
85
+ get lc_aliases(): {
86
+ [key: string]: string;
87
+ } | undefined;
88
+ private isChatModel;
89
+ constructor(inputs: TogetherAIInputs);
90
+ _llmType(): string;
91
+ private constructHeaders;
92
+ private constructBody;
93
+ completionWithRetry(prompt: string, options?: this["ParsedCallOptions"]): Promise<any>;
94
+ _call(prompt: string, options?: this["ParsedCallOptions"]): Promise<string>;
95
+ _streamResponseChunks(prompt: string, options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<GenerationChunk>;
96
+ }
97
+ //#endregion
98
+ export { TogetherAI, TogetherAICallOptions, TogetherAIInputs };
99
+ //# sourceMappingURL=llms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llms.d.ts","names":[],"sources":["../src/llms.ts"],"mappings":";;;;;UA4CiB,gBAAA,SAAyB,aAAA;;AAA1C;;;EAKE,MAAA;EALwC;;;;EAUxC,SAAA;EAcA;;;EAVA,KAAA;EA6BA;;;;EAxBA,WAAA;EAoCI;AAGN;;;EAlCE,SAAA;EAoCE;;;;EA/BF,IAAA;EAgCE;;;;EA3BF,IAAA;EAyCsB;;;;EApCtB,iBAAA;EAwJqC;;;EApJrC,QAAA;EAs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