langchain 0.0.71 → 0.0.72

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.
@@ -1,5 +1,5 @@
1
1
  import { CreateChatCompletionRequest, ConfigurationParameters, CreateChatCompletionResponse } from "openai";
2
- import { AzureOpenAIInput, OpenAICallOptions, OpenAIChatInput } from "../types/open-ai-types.js";
2
+ import { AzureOpenAIInput, OpenAICallOptions, OpenAIChatInput } from "../types/openai-types.js";
3
3
  import type { StreamingAxiosConfiguration } from "../util/axios-types.js";
4
4
  import { BaseChatModel, BaseChatModelParams } from "./base.js";
5
5
  import { BaseChatMessage, ChatResult } from "../schema/index.js";
@@ -1,5 +1,5 @@
1
1
  import { ConfigurationParameters } from "openai";
2
- import { AzureOpenAIInput } from "../types/open-ai-types.js";
2
+ import { AzureOpenAIInput } from "../types/openai-types.js";
3
3
  import { Embeddings, EmbeddingsParams } from "./base.js";
4
4
  export interface OpenAIEmbeddingsParams extends EmbeddingsParams {
5
5
  /** Model name to use */
@@ -1,5 +1,5 @@
1
1
  import { ChatCompletionRequestMessage, CreateChatCompletionRequest, ConfigurationParameters, CreateChatCompletionResponse } from "openai";
2
- import { AzureOpenAIInput, OpenAICallOptions, OpenAIChatInput } from "../types/open-ai-types.js";
2
+ import { AzureOpenAIInput, OpenAICallOptions, OpenAIChatInput } from "../types/openai-types.js";
3
3
  import type { StreamingAxiosConfiguration } from "../util/axios-types.js";
4
4
  import { BaseLLMParams, LLM } from "./base.js";
5
5
  import { CallbackManagerForLLMRun } from "../callbacks/manager.js";
@@ -1,5 +1,5 @@
1
1
  import { ConfigurationParameters, CreateCompletionRequest, CreateCompletionResponse } from "openai";
2
- import { AzureOpenAIInput, OpenAICallOptions, OpenAIInput } from "../types/open-ai-types.js";
2
+ import { AzureOpenAIInput, OpenAICallOptions, OpenAIInput } from "../types/openai-types.js";
3
3
  import type { StreamingAxiosConfiguration } from "../util/axios-types.js";
4
4
  import { BaseLLM, BaseLLMParams } from "./base.js";
5
5
  import { LLMResult } from "../schema/index.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,101 @@
1
+ import { AxiosRequestConfig } from "axios";
2
+ import { ChatCompletionRequestMessage } from "openai";
3
+ import { BaseLanguageModelCallOptions } from "../base_language/index.js";
4
+ export declare interface OpenAIBaseInput {
5
+ /** Sampling temperature to use */
6
+ temperature: number;
7
+ /**
8
+ * Maximum number of tokens to generate in the completion. -1 returns as many
9
+ * tokens as possible given the prompt and the model's maximum context size.
10
+ */
11
+ maxTokens?: number;
12
+ /** Total probability mass of tokens to consider at each step */
13
+ topP: number;
14
+ /** Penalizes repeated tokens according to frequency */
15
+ frequencyPenalty: number;
16
+ /** Penalizes repeated tokens */
17
+ presencePenalty: number;
18
+ /** Number of completions to generate for each prompt */
19
+ n: number;
20
+ /** Dictionary used to adjust the probability of specific tokens being generated */
21
+ logitBias?: Record<string, number>;
22
+ /** Whether to stream the results or not. Enabling disables tokenUsage reporting */
23
+ streaming: boolean;
24
+ /** Model name to use */
25
+ modelName: string;
26
+ /** Holds any additional parameters that are valid to pass to {@link
27
+ * https://platform.openai.com/docs/api-reference/completions/create |
28
+ * `openai.createCompletion`} that are not explicitly specified on this class.
29
+ */
30
+ modelKwargs?: Record<string, any>;
31
+ /** List of stop words to use when generating */
32
+ stop?: string[];
33
+ /**
34
+ * Timeout to use when making requests to OpenAI.
35
+ */
36
+ timeout?: number;
37
+ }
38
+ export interface OpenAICallOptions extends BaseLanguageModelCallOptions {
39
+ /**
40
+ * List of stop words to use when generating
41
+ */
42
+ stop?: string[];
43
+ /**
44
+ * Additional options to pass to the underlying axios request.
45
+ */
46
+ options?: AxiosRequestConfig;
47
+ }
48
+ /**
49
+ * Input to OpenAI class.
50
+ */
51
+ export declare interface OpenAIInput extends OpenAIBaseInput {
52
+ /** Generates `bestOf` completions server side and returns the "best" */
53
+ bestOf: number;
54
+ /** Batch size to use when passing multiple documents to generate */
55
+ batchSize: number;
56
+ }
57
+ export interface OpenAIChatInput extends OpenAIBaseInput {
58
+ /** ChatGPT messages to pass as a prefix to the prompt */
59
+ prefixMessages?: ChatCompletionRequestMessage[];
60
+ }
61
+ export declare interface AzureOpenAIInput {
62
+ /**
63
+ * API version to use when making requests to Azure OpenAI.
64
+ */
65
+ azureOpenAIApiVersion?: string;
66
+ /**
67
+ * API key to use when making requests to Azure OpenAI.
68
+ */
69
+ azureOpenAIApiKey?: string;
70
+ /**
71
+ * Azure OpenAI API instance name to use when making requests to Azure OpenAI.
72
+ * this is the name of the instance you created in the Azure portal.
73
+ * e.g. "my-openai-instance"
74
+ * this will be used in the endpoint URL: https://my-openai-instance.openai.azure.com/openai/deployments/{DeploymentName}/
75
+ */
76
+ azureOpenAIApiInstanceName?: string;
77
+ /**
78
+ * Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.
79
+ * This is the name of the deployment you created in the Azure portal.
80
+ * e.g. "my-openai-deployment"
81
+ * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
82
+ */
83
+ azureOpenAIApiDeploymentName?: string;
84
+ /**
85
+ * Azure OpenAI API deployment name to use for embedding when making requests to Azure OpenAI.
86
+ * This is the name of the deployment you created in the Azure portal.
87
+ * This will fallback to azureOpenAIApiDeploymentName if not provided.
88
+ * e.g. "my-openai-deployment"
89
+ * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
90
+ */
91
+ azureOpenAIApiEmbeddingsDeploymentName?: string;
92
+ /**
93
+ * Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.
94
+ * Completions are only available for gpt-3.5-turbo and text-davinci-003 deployments.
95
+ * This is the name of the deployment you created in the Azure portal.
96
+ * This will fallback to azureOpenAIApiDeploymentName if not provided.
97
+ * e.g. "my-openai-deployment"
98
+ * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
99
+ */
100
+ azureOpenAIApiCompletionsDeploymentName?: string;
101
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {