From df1baf8cf19d6fbccd848282704369f1d8ef169c Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 5 Feb 2025 13:09:21 -0300 Subject: [PATCH 1/4] deepseek init --- .../create-chat-completion.mjs | 121 ++++++++++++++ .../actions/get-balance/get-balance.mjs | 21 +++ .../actions/list-models/list-models.mjs | 21 +++ components/deepseek/deepseek.app.mjs | 158 +++++++++++++++++- components/deepseek/package.json | 2 +- 5 files changed, 320 insertions(+), 3 deletions(-) create mode 100644 components/deepseek/actions/create-chat-completion/create-chat-completion.mjs create mode 100644 components/deepseek/actions/get-balance/get-balance.mjs create mode 100644 components/deepseek/actions/list-models/list-models.mjs diff --git a/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs b/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs new file mode 100644 index 0000000000000..890e58c8d56ee --- /dev/null +++ b/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs @@ -0,0 +1,121 @@ +import deepseek from "../../deepseek.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "deepseek-create-chat-completion", + name: "Create Chat Completion", + description: "Creates a chat completion using the DeepSeek API. [See the documentation]()", + version: "0.0.{{ts}}", + type: "action", + props: { + deepseek, + messages: { + propDefinition: [ + "deepseek", + "messages", + ], + }, + model: { + propDefinition: [ + "deepseek", + "model", + ], + }, + frequencyPenalty: { + propDefinition: [ + "deepseek", + "frequencyPenalty", + ], + optional: true, + }, + maxTokens: { + propDefinition: [ + "deepseek", + "maxTokens", + ], + optional: true, + }, + presencePenalty: { + propDefinition: [ + "deepseek", + "presencePenalty", + ], + optional: true, + }, + responseFormat: { + propDefinition: [ + "deepseek", + "responseFormat", + ], + optional: true, + }, + stop: { + propDefinition: [ + "deepseek", + "stop", + ], + optional: true, + }, + stream: { + propDefinition: [ + "deepseek", + "stream", + ], + optional: true, + }, + streamOptions: { + propDefinition: [ + "deepseek", + "streamOptions", + ], + optional: true, + }, + temperature: { + propDefinition: [ + "deepseek", + "temperature", + ], + optional: true, + }, + topP: { + propDefinition: [ + "deepseek", + "topP", + ], + optional: true, + }, + tools: { + propDefinition: [ + "deepseek", + "tools", + ], + optional: true, + }, + toolChoice: { + propDefinition: [ + "deepseek", + "toolChoice", + ], + optional: true, + }, + logprobs: { + propDefinition: [ + "deepseek", + "logprobs", + ], + optional: true, + }, + topLogprobs: { + propDefinition: [ + "deepseek", + "topLogprobs", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.deepseek.createModelResponse(); + $.export("$summary", `Chat completion created: ${response.choices[0].message.content}`); + return response; + }, +}; diff --git a/components/deepseek/actions/get-balance/get-balance.mjs b/components/deepseek/actions/get-balance/get-balance.mjs new file mode 100644 index 0000000000000..0a993087f58e2 --- /dev/null +++ b/components/deepseek/actions/get-balance/get-balance.mjs @@ -0,0 +1,21 @@ +import deepseek from "../../deepseek.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "deepseek-get-balance", + name: "Get User Balance", + description: "Retrieves the user's current balance. [See the documentation](https://api-docs.deepseek.com/api/get-user-balance)", + version: "0.0.{{ts}}", + type: "action", + props: { + deepseek: { + type: "app", + app: "deepseek", + }, + }, + async run({ $ }) { + const response = await this.deepseek.getUserBalance(); + $.export("$summary", "Successfully retrieved user balance"); + return response; + }, +}; diff --git a/components/deepseek/actions/list-models/list-models.mjs b/components/deepseek/actions/list-models/list-models.mjs new file mode 100644 index 0000000000000..4c67be30487d3 --- /dev/null +++ b/components/deepseek/actions/list-models/list-models.mjs @@ -0,0 +1,21 @@ +import deepseek from "../../deepseek.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "deepseek-list-models", + name: "List Models", + description: "Lists the currently available models, and provides basic information about each one such as the owner and availability. [See the documentation](https://api-docs.deepseek.com/)", + version: "0.0.{{ts}}", + type: "action", + props: { + deepseek: { + type: "app", + app: "deepseek", + }, + }, + async run({ $ }) { + const models = await this.deepseek.listModels(); + $.export("$summary", "Successfully listed models"); + return models; + }, +}; diff --git a/components/deepseek/deepseek.app.mjs b/components/deepseek/deepseek.app.mjs index 1e3cfe2aae7a5..f0b66b5d9ab72 100644 --- a/components/deepseek/deepseek.app.mjs +++ b/components/deepseek/deepseek.app.mjs @@ -1,11 +1,165 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "deepseek", - propDefinitions: {}, + version: "0.0.{{ts}}", + propDefinitions: { + messages: { + type: "string[]", + label: "Messages", + description: "The messages for the chat conversation as JSON strings. Each message should be a JSON string like '{\"role\": \"user\", \"content\": \"Hello!\"}'.", + }, + model: { + type: "string", + label: "Model", + description: "The model to use for generating the chat completion.", + async options() { + const models = await this.listModels(); + return models.map((model) => ({ + label: `${model.id} (Owned by ${model.owner})`, + value: model.id, + })); + }, + }, + frequencyPenalty: { + type: "number", + label: "Frequency Penalty", + description: "Amount to penalize new tokens based on their frequency in the text so far.", + optional: true, + }, + maxTokens: { + type: "integer", + label: "Max Tokens", + description: "The maximum number of tokens to generate in the completion.", + optional: true, + }, + presencePenalty: { + type: "number", + label: "Presence Penalty", + description: "Amount to penalize new tokens based on their presence in the text so far.", + optional: true, + }, + responseFormat: { + type: "string", + label: "Response Format", + description: "The format of the response.", + optional: true, + }, + stop: { + type: "string[]", + label: "Stop Sequences", + description: "Sequences where the API will stop generating further tokens.", + optional: true, + }, + stream: { + type: "boolean", + label: "Stream", + description: "Whether to stream the response.", + optional: true, + }, + streamOptions: { + type: "string", + label: "Stream Options", + description: "Options for streaming the response.", + optional: true, + }, + temperature: { + type: "number", + label: "Temperature", + description: "Sampling temperature, between 0 and 2.", + optional: true, + }, + topP: { + type: "number", + label: "Top P", + description: "Nucleus sampling probability, between 0 and 1.", + optional: true, + }, + tools: { + type: "string[]", + label: "Tools", + description: "Tools to be used in the generation.", + optional: true, + }, + toolChoice: { + type: "string", + label: "Tool Choice", + description: "Choice of tool.", + optional: true, + }, + logprobs: { + type: "integer", + label: "Log Probs", + description: "Number of top log probabilities to return.", + optional: true, + }, + topLogprobs: { + type: "integer", + label: "Top Log Probabilities", + description: "Return the top log probabilities.", + optional: true, + }, + }, methods: { - // this.$auth contains connected account data authKeys() { console.log(Object.keys(this.$auth)); }, + _baseUrl() { + return "https://api.deepseek.com"; + }, + async _makeRequest(opts = {}) { + const { + $, method = "GET", path = "/", headers, ...otherOpts + } = opts; + return axios($, { + method, + url: this._baseUrl() + path, + headers: { + ...headers, + "Authorization": `Bearer ${this.$auth.api_key}`, + "Accept": "application/json", + "Content-Type": "application/json", + }, + ...otherOpts, + }); + }, + async createModelResponse() { + const data = { + messages: this.messages.map((message) => JSON.parse(message)), + model: this.model, + }; + if (this.frequencyPenalty !== undefined) data.frequency_penalty = this.frequencyPenalty; + if (this.maxTokens !== undefined) data.max_tokens = this.maxTokens; + if (this.presencePenalty !== undefined) data.presence_penalty = this.presencePenalty; + if (this.responseFormat !== undefined) data.response_format = this.responseFormat; + if (this.stop !== undefined) data.stop = this.stop; + if (this.stream !== undefined) data.stream = this.stream; + if (this.streamOptions !== undefined) data.stream_options = this.streamOptions; + if (this.temperature !== undefined) data.temperature = this.temperature; + if (this.topP !== undefined) data.top_p = this.topP; + if (this.tools !== undefined) data.tools = this.tools; + if (this.toolChoice !== undefined) data.tool_choice = this.toolChoice; + if (this.logprobs !== undefined) data.logprobs = this.logprobs; + if (this.topLogprobs !== undefined) data.top_logprobs = this.topLogprobs; + + return this._makeRequest({ + method: "POST", + path: "/chat/completions", + data, + }); + }, + async getUserBalance() { + return this._makeRequest({ + method: "GET", + path: "/user/balance", + }); + }, + async listModels() { + return this._makeRequest({ + method: "GET", + path: "/models", + }); + }, }, }; diff --git a/components/deepseek/package.json b/components/deepseek/package.json index 0763e10c2c8ea..e6d13915b27d2 100644 --- a/components/deepseek/package.json +++ b/components/deepseek/package.json @@ -12,4 +12,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} From cedfe17db03eb7a7c907266167516d0a229ba0d4 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 5 Feb 2025 16:01:54 -0300 Subject: [PATCH 2/4] [Components] deepseek #15444 Actions - Create Chat Completion - Get Balance - List Models --- .../create-chat-completion.mjs | 153 ++++++++++-------- .../actions/get-balance/get-balance.mjs | 12 +- .../actions/list-models/list-models.mjs | 14 +- components/deepseek/common/constants.mjs | 10 ++ components/deepseek/common/util.mjs | 24 +++ components/deepseek/deepseek.app.mjs | 149 ++--------------- components/deepseek/package.json | 5 +- 7 files changed, 147 insertions(+), 220 deletions(-) create mode 100644 components/deepseek/common/constants.mjs create mode 100644 components/deepseek/common/util.mjs diff --git a/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs b/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs index 890e58c8d56ee..329587ad99244 100644 --- a/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs +++ b/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs @@ -1,121 +1,136 @@ +import { RESPONSE_FORMAT_TYPE_OPTIONS } from "../../common/constants.mjs"; +import { parseObject } from "../../common/util.mjs"; import deepseek from "../../deepseek.app.mjs"; -import { axios } from "@pipedream/platform"; export default { key: "deepseek-create-chat-completion", name: "Create Chat Completion", - description: "Creates a chat completion using the DeepSeek API. [See the documentation]()", - version: "0.0.{{ts}}", + description: "Creates a chat completion using the DeepSeek API. [See the documentation](https://api-docs.deepseek.com/api/create-chat-completion)", + version: "0.0.1", type: "action", props: { deepseek, messages: { - propDefinition: [ - "deepseek", - "messages", - ], - }, - model: { - propDefinition: [ - "deepseek", - "model", - ], + type: "string[]", + label: "Messages", + description: "The messages for the chat conversation as JSON strings. Each message should be a JSON string like '{\"role\": \"user\", \"content\": \"Hello!\"}'. [See the documentation](https://api-docs.deepseek.com/api/create-chat-completion) for further details.", }, frequencyPenalty: { - propDefinition: [ - "deepseek", - "frequencyPenalty", - ], + type: "string", + label: "Frequency Penalty", + description: "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.", optional: true, }, maxTokens: { - propDefinition: [ - "deepseek", - "maxTokens", - ], + type: "integer", + label: "Max Tokens", + description: "Integer between 1 and 8192. The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. If `max_tokens` is not specified, the default value 4096 is used.", optional: true, }, presencePenalty: { - propDefinition: [ - "deepseek", - "presencePenalty", - ], + type: "string", + label: "Presence Penalty", + description: "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.", optional: true, }, - responseFormat: { - propDefinition: [ - "deepseek", - "responseFormat", - ], + responseFormatType: { + type: "string", + label: "Response Format Type", + description: "The format that the model must output. Setting to JSON Object enables JSON Output, which guarantees the message the model generates is valid JSON.", + options: RESPONSE_FORMAT_TYPE_OPTIONS, optional: true, }, stop: { - propDefinition: [ - "deepseek", - "stop", - ], + type: "string[]", + label: "Stop Sequences", + description: "Up to 16 sequences where the API will stop generating further tokens.", optional: true, }, stream: { - propDefinition: [ - "deepseek", - "stream", - ], + type: "boolean", + label: "Stream", + description: "If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events (SSE) as they become available, with the stream terminated by a `data: [DONE]` message.", optional: true, + reloadProps: true, }, - streamOptions: { - propDefinition: [ - "deepseek", - "streamOptions", - ], + streamIncludeUsage: { + type: "string", + label: "Stream Include Usage", + description: "If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.", optional: true, + hidden: true, }, temperature: { - propDefinition: [ - "deepseek", - "temperature", - ], + type: "string", + label: "Temperature", + description: "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or Top P but not both.", optional: true, }, topP: { - propDefinition: [ - "deepseek", - "topP", - ], + type: "string", + label: "Top P", + description: "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or Temperature but not both.", optional: true, }, tools: { - propDefinition: [ - "deepseek", - "tools", - ], + type: "string[]", + label: "Tools", + description: "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.", optional: true, }, toolChoice: { - propDefinition: [ - "deepseek", - "toolChoice", - ], + type: "string", + label: "Tool Choice", + description: "Controls which (if any) tool is called by the model. [See the documentation](https://api-docs.deepseek.com/api/create-chat-completion) for further details.", optional: true, }, logprobs: { - propDefinition: [ - "deepseek", - "logprobs", - ], + type: "boolean", + label: "Log Probs", + description: "Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.", optional: true, }, topLogprobs: { - propDefinition: [ - "deepseek", - "topLogprobs", - ], + type: "string", + label: "Top Log Probabilities", + description: "An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.", optional: true, }, }, + async additionalProps(props) { + props.streamIncludeUsage.hidden = !this.stream; + return {}; + }, async run({ $ }) { - const response = await this.deepseek.createModelResponse(); - $.export("$summary", `Chat completion created: ${response.choices[0].message.content}`); + const response = await this.deepseek.createModelResponse({ + $, + data: { + messages: parseObject(this.messages), + model: "deepseek-chat", + frequency_penalty: this.frequencyPenalty && parseInt(this.frequencyPenalty), + max_tokens: this.maxTokens, + presence_penalty: this.presencePenalty && parseInt(this.presencePenalty), + response_format: this.responseFormatType + ? { + type: this.responseFormatType, + } + : null, + stop: parseObject(this.stop), + stream: this.stream, + stream_options: this.stram + ? { + include_usage: this.streamIncludeUsage, + } + : null, + temperature: this.temperature && parseInt(this.temperature), + top_p: this.topP && parseInt(this.topP), + tools: parseObject(this.tools), + tool_choice: parseObject(this.toolChoice), + logprobs: this.logprobs, + top_logprobs: this.topLogprobs && parseInt(this.topLogprobs), + }, + }); + $.export("$summary", "Chat completion created"); return response; }, }; diff --git a/components/deepseek/actions/get-balance/get-balance.mjs b/components/deepseek/actions/get-balance/get-balance.mjs index 0a993087f58e2..c621fc32bfed9 100644 --- a/components/deepseek/actions/get-balance/get-balance.mjs +++ b/components/deepseek/actions/get-balance/get-balance.mjs @@ -1,20 +1,18 @@ import deepseek from "../../deepseek.app.mjs"; -import { axios } from "@pipedream/platform"; export default { key: "deepseek-get-balance", name: "Get User Balance", description: "Retrieves the user's current balance. [See the documentation](https://api-docs.deepseek.com/api/get-user-balance)", - version: "0.0.{{ts}}", + version: "0.0.1", type: "action", props: { - deepseek: { - type: "app", - app: "deepseek", - }, + deepseek, }, async run({ $ }) { - const response = await this.deepseek.getUserBalance(); + const response = await this.deepseek.getUserBalance({ + $, + }); $.export("$summary", "Successfully retrieved user balance"); return response; }, diff --git a/components/deepseek/actions/list-models/list-models.mjs b/components/deepseek/actions/list-models/list-models.mjs index 4c67be30487d3..b867caba2e520 100644 --- a/components/deepseek/actions/list-models/list-models.mjs +++ b/components/deepseek/actions/list-models/list-models.mjs @@ -1,20 +1,18 @@ import deepseek from "../../deepseek.app.mjs"; -import { axios } from "@pipedream/platform"; export default { key: "deepseek-list-models", name: "List Models", - description: "Lists the currently available models, and provides basic information about each one such as the owner and availability. [See the documentation](https://api-docs.deepseek.com/)", - version: "0.0.{{ts}}", + description: "Lists the currently available models, and provides basic information about each one such as the owner and availability. [See the documentation](https://api-docs.deepseek.com/api/list-models)", + version: "0.0.1", type: "action", props: { - deepseek: { - type: "app", - app: "deepseek", - }, + deepseek, }, async run({ $ }) { - const models = await this.deepseek.listModels(); + const models = await this.deepseek.listModels({ + $, + }); $.export("$summary", "Successfully listed models"); return models; }, diff --git a/components/deepseek/common/constants.mjs b/components/deepseek/common/constants.mjs new file mode 100644 index 0000000000000..f5de38062a1d9 --- /dev/null +++ b/components/deepseek/common/constants.mjs @@ -0,0 +1,10 @@ +export const RESPONSE_FORMAT_TYPE_OPTIONS = [ + { + label: "Text", + value: "text", + }, + { + label: "JSON Object", + value: "json_object", + }, +]; diff --git a/components/deepseek/common/util.mjs b/components/deepseek/common/util.mjs new file mode 100644 index 0000000000000..dcc9cc61f6f41 --- /dev/null +++ b/components/deepseek/common/util.mjs @@ -0,0 +1,24 @@ +export const parseObject = (obj) => { + if (!obj) return undefined; + + if (Array.isArray(obj)) { + return obj.map((item) => { + if (typeof item === "string") { + try { + return JSON.parse(item); + } catch (e) { + return item; + } + } + return item; + }); + } + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch (e) { + return obj; + } + } + return obj; +}; diff --git a/components/deepseek/deepseek.app.mjs b/components/deepseek/deepseek.app.mjs index f0b66b5d9ab72..7ecf9ef719a83 100644 --- a/components/deepseek/deepseek.app.mjs +++ b/components/deepseek/deepseek.app.mjs @@ -3,159 +3,38 @@ import { axios } from "@pipedream/platform"; export default { type: "app", app: "deepseek", - version: "0.0.{{ts}}", - propDefinitions: { - messages: { - type: "string[]", - label: "Messages", - description: "The messages for the chat conversation as JSON strings. Each message should be a JSON string like '{\"role\": \"user\", \"content\": \"Hello!\"}'.", - }, - model: { - type: "string", - label: "Model", - description: "The model to use for generating the chat completion.", - async options() { - const models = await this.listModels(); - return models.map((model) => ({ - label: `${model.id} (Owned by ${model.owner})`, - value: model.id, - })); - }, - }, - frequencyPenalty: { - type: "number", - label: "Frequency Penalty", - description: "Amount to penalize new tokens based on their frequency in the text so far.", - optional: true, - }, - maxTokens: { - type: "integer", - label: "Max Tokens", - description: "The maximum number of tokens to generate in the completion.", - optional: true, - }, - presencePenalty: { - type: "number", - label: "Presence Penalty", - description: "Amount to penalize new tokens based on their presence in the text so far.", - optional: true, - }, - responseFormat: { - type: "string", - label: "Response Format", - description: "The format of the response.", - optional: true, - }, - stop: { - type: "string[]", - label: "Stop Sequences", - description: "Sequences where the API will stop generating further tokens.", - optional: true, - }, - stream: { - type: "boolean", - label: "Stream", - description: "Whether to stream the response.", - optional: true, - }, - streamOptions: { - type: "string", - label: "Stream Options", - description: "Options for streaming the response.", - optional: true, - }, - temperature: { - type: "number", - label: "Temperature", - description: "Sampling temperature, between 0 and 2.", - optional: true, - }, - topP: { - type: "number", - label: "Top P", - description: "Nucleus sampling probability, between 0 and 1.", - optional: true, - }, - tools: { - type: "string[]", - label: "Tools", - description: "Tools to be used in the generation.", - optional: true, - }, - toolChoice: { - type: "string", - label: "Tool Choice", - description: "Choice of tool.", - optional: true, - }, - logprobs: { - type: "integer", - label: "Log Probs", - description: "Number of top log probabilities to return.", - optional: true, - }, - topLogprobs: { - type: "integer", - label: "Top Log Probabilities", - description: "Return the top log probabilities.", - optional: true, - }, - }, methods: { - authKeys() { - console.log(Object.keys(this.$auth)); - }, _baseUrl() { return "https://api.deepseek.com"; }, - async _makeRequest(opts = {}) { - const { - $, method = "GET", path = "/", headers, ...otherOpts - } = opts; + _headers() { + return { + "Authorization": `Bearer ${this.$auth.api_key}`, + }; + }, + _makeRequest({ + $ = this, path, ...opts + }) { return axios($, { - method, url: this._baseUrl() + path, - headers: { - ...headers, - "Authorization": `Bearer ${this.$auth.api_key}`, - "Accept": "application/json", - "Content-Type": "application/json", - }, - ...otherOpts, + headers: this._headers(), + ...opts, }); }, - async createModelResponse() { - const data = { - messages: this.messages.map((message) => JSON.parse(message)), - model: this.model, - }; - if (this.frequencyPenalty !== undefined) data.frequency_penalty = this.frequencyPenalty; - if (this.maxTokens !== undefined) data.max_tokens = this.maxTokens; - if (this.presencePenalty !== undefined) data.presence_penalty = this.presencePenalty; - if (this.responseFormat !== undefined) data.response_format = this.responseFormat; - if (this.stop !== undefined) data.stop = this.stop; - if (this.stream !== undefined) data.stream = this.stream; - if (this.streamOptions !== undefined) data.stream_options = this.streamOptions; - if (this.temperature !== undefined) data.temperature = this.temperature; - if (this.topP !== undefined) data.top_p = this.topP; - if (this.tools !== undefined) data.tools = this.tools; - if (this.toolChoice !== undefined) data.tool_choice = this.toolChoice; - if (this.logprobs !== undefined) data.logprobs = this.logprobs; - if (this.topLogprobs !== undefined) data.top_logprobs = this.topLogprobs; - + createModelResponse(opts = {}) { return this._makeRequest({ method: "POST", path: "/chat/completions", - data, + ...opts, }); }, - async getUserBalance() { + getUserBalance() { return this._makeRequest({ method: "GET", path: "/user/balance", }); }, - async listModels() { + listModels() { return this._makeRequest({ method: "GET", path: "/models", diff --git a/components/deepseek/package.json b/components/deepseek/package.json index e6d13915b27d2..f520a8520fe49 100644 --- a/components/deepseek/package.json +++ b/components/deepseek/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/deepseek", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream DeepSeek Components", "main": "deepseek.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } } From 36c975ec09d946259a21ffb4a8cabe5dbfb262b8 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 5 Feb 2025 16:07:05 -0300 Subject: [PATCH 3/4] pnpm update --- pnpm-lock.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be12ad6b860ee..f46eafa0cf617 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2615,7 +2615,11 @@ importers: components/deepl: {} - components/deepseek: {} + components/deepseek: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/defastra: dependencies: @@ -5694,8 +5698,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/klipy: - specifiers: {} + components/klipy: {} components/knack: dependencies: From e9c09baef14987e1321e424a688052f2145abe80 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 10 Feb 2025 16:33:28 -0300 Subject: [PATCH 4/4] Update components/deepseek/actions/create-chat-completion/create-chat-completion.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../actions/create-chat-completion/create-chat-completion.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs b/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs index 329587ad99244..8cdbd0f1b8981 100644 --- a/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs +++ b/components/deepseek/actions/create-chat-completion/create-chat-completion.mjs @@ -117,7 +117,7 @@ export default { : null, stop: parseObject(this.stop), stream: this.stream, - stream_options: this.stram + stream_options: this.stream ? { include_usage: this.streamIncludeUsage, }