Merge pull request #769 from FlowiseAI/bugfix/ReplicateAPIKey

Bugfix/Replicate APIkey
This commit is contained in:
Henry Heng
2023-08-15 13:46:18 +01:00
committed by GitHub
2 changed files with 24 additions and 19 deletions
@@ -97,7 +97,7 @@ class Replicate_LLMs implements INode {
const additionalInputs = nodeData.inputs?.additionalInputs as string const additionalInputs = nodeData.inputs?.additionalInputs as string
const credentialData = await getCredentialData(nodeData.credential ?? '', options) const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const apiKey = getCredentialParam('apiKey', credentialData, nodeData) const apiKey = getCredentialParam('replicateApiKey', credentialData, nodeData)
const version = modelName.split(':').pop() const version = modelName.split(':').pop()
const name = modelName.split(':')[0].split('/').pop() const name = modelName.split(':')[0].split('/').pop()
@@ -13,8 +13,8 @@
"data": { "data": {
"id": "llmChain_1", "id": "llmChain_1",
"label": "LLM Chain", "label": "LLM Chain",
"name": "llmChain",
"version": 1, "version": 1,
"name": "llmChain",
"type": "LLMChain", "type": "LLMChain",
"baseClasses": ["LLMChain", "BaseChain", "BaseLangChain"], "baseClasses": ["LLMChain", "BaseChain", "BaseLangChain"],
"category": "Chains", "category": "Chains",
@@ -84,7 +84,7 @@
}, },
{ {
"width": 300, "width": 300,
"height": 475, "height": 474,
"id": "promptTemplate_0", "id": "promptTemplate_0",
"position": { "position": {
"x": 269.2203229225663, "x": 269.2203229225663,
@@ -94,8 +94,8 @@
"data": { "data": {
"id": "promptTemplate_0", "id": "promptTemplate_0",
"label": "Prompt Template", "label": "Prompt Template",
"name": "promptTemplate",
"version": 1, "version": 1,
"name": "promptTemplate",
"type": "PromptTemplate", "type": "PromptTemplate",
"baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"], "baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
"category": "Prompts", "category": "Prompts",
@@ -144,28 +144,29 @@
}, },
{ {
"width": 300, "width": 300,
"height": 527, "height": 526,
"id": "replicate_0", "id": "replicate_0",
"position": { "position": {
"x": 607.4915400488668, "x": 623.313978186024,
"y": -60.643337207007804 "y": -72.92788335022428
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
"id": "replicate_0", "id": "replicate_0",
"label": "Replicate", "label": "Replicate",
"name": "replicate",
"version": 1, "version": 1,
"name": "replicate",
"type": "Replicate", "type": "Replicate",
"baseClasses": ["Replicate", "LLM", "BaseLLM", "BaseLanguageModel"], "baseClasses": ["Replicate", "BaseChatModel", "LLM", "BaseLLM", "BaseLanguageModel", "Runnable"],
"category": "LLMs", "category": "LLMs",
"description": "Use Replicate to run open source models on cloud", "description": "Use Replicate to run open source models on cloud",
"inputParams": [ "inputParams": [
{ {
"label": "Replicate Api Key", "label": "Connect Credential",
"name": "replicateApiKey", "name": "credential",
"type": "password", "type": "credential",
"id": "replicate_0-input-replicateApiKey-password" "credentialNames": ["replicateApi"],
"id": "replicate_0-input-credential-credential"
}, },
{ {
"label": "Model", "label": "Model",
@@ -179,6 +180,7 @@
"label": "Temperature", "label": "Temperature",
"name": "temperature", "name": "temperature",
"type": "number", "type": "number",
"step": 0.1,
"description": "Adjusts randomness of outputs, greater than 1 is random and 0 is deterministic, 0.75 is a good starting value.", "description": "Adjusts randomness of outputs, greater than 1 is random and 0 is deterministic, 0.75 is a good starting value.",
"default": 0.7, "default": 0.7,
"optional": true, "optional": true,
@@ -188,6 +190,7 @@
"label": "Max Tokens", "label": "Max Tokens",
"name": "maxTokens", "name": "maxTokens",
"type": "number", "type": "number",
"step": 1,
"description": "Maximum number of tokens to generate. A word is generally 2-3 tokens", "description": "Maximum number of tokens to generate. A word is generally 2-3 tokens",
"optional": true, "optional": true,
"additionalParams": true, "additionalParams": true,
@@ -197,6 +200,7 @@
"label": "Top Probability", "label": "Top Probability",
"name": "topP", "name": "topP",
"type": "number", "type": "number",
"step": 0.1,
"description": "When decoding text, samples from the top p percentage of most likely tokens; lower to ignore less likely tokens", "description": "When decoding text, samples from the top p percentage of most likely tokens; lower to ignore less likely tokens",
"optional": true, "optional": true,
"additionalParams": true, "additionalParams": true,
@@ -206,6 +210,7 @@
"label": "Repetition Penalty", "label": "Repetition Penalty",
"name": "repetitionPenalty", "name": "repetitionPenalty",
"type": "number", "type": "number",
"step": 0.1,
"description": "Penalty for repeated words in generated text; 1 is no penalty, values greater than 1 discourage repetition, less than 1 encourage it. (minimum: 0.01; maximum: 5)", "description": "Penalty for repeated words in generated text; 1 is no penalty, values greater than 1 discourage repetition, less than 1 encourage it. (minimum: 0.01; maximum: 5)",
"optional": true, "optional": true,
"additionalParams": true, "additionalParams": true,
@@ -232,10 +237,10 @@
}, },
"outputAnchors": [ "outputAnchors": [
{ {
"id": "replicate_0-output-replicate-Replicate|LLM|BaseLLM|BaseLanguageModel", "id": "replicate_0-output-replicate-Replicate|BaseChatModel|LLM|BaseLLM|BaseLanguageModel|Runnable",
"name": "replicate", "name": "replicate",
"label": "Replicate", "label": "Replicate",
"type": "Replicate | LLM | BaseLLM | BaseLanguageModel" "type": "Replicate | BaseChatModel | LLM | BaseLLM | BaseLanguageModel | Runnable"
} }
], ],
"outputs": {}, "outputs": {},
@@ -243,8 +248,8 @@
}, },
"selected": false, "selected": false,
"positionAbsolute": { "positionAbsolute": {
"x": 607.4915400488668, "x": 623.313978186024,
"y": -60.643337207007804 "y": -72.92788335022428
}, },
"dragging": false "dragging": false
} }
@@ -263,11 +268,11 @@
}, },
{ {
"source": "replicate_0", "source": "replicate_0",
"sourceHandle": "replicate_0-output-replicate-Replicate|LLM|BaseLLM|BaseLanguageModel", "sourceHandle": "replicate_0-output-replicate-Replicate|BaseChatModel|LLM|BaseLLM|BaseLanguageModel|Runnable",
"target": "llmChain_1", "target": "llmChain_1",
"targetHandle": "llmChain_1-input-model-BaseLanguageModel", "targetHandle": "llmChain_1-input-model-BaseLanguageModel",
"type": "buttonedge", "type": "buttonedge",
"id": "replicate_0-replicate_0-output-replicate-Replicate|LLM|BaseLLM|BaseLanguageModel-llmChain_1-llmChain_1-input-model-BaseLanguageModel", "id": "replicate_0-replicate_0-output-replicate-Replicate|BaseChatModel|LLM|BaseLLM|BaseLanguageModel|Runnable-llmChain_1-llmChain_1-input-model-BaseLanguageModel",
"data": { "data": {
"label": "" "label": ""
} }