refactor: Update logs field in ResultDataResponse schema
Update the logs field in the ResultDataResponse schema to allow for a list of logs or a single log. This change ensures compatibility with the latest langflow library updates and improves the flexibility of the schema.
This commit is contained in:
parent
6357d245aa
commit
40ce88b9ea
6 changed files with 797 additions and 241 deletions
|
|
@ -245,7 +245,7 @@ class VerticesOrderResponse(BaseModel):
|
|||
|
||||
class ResultDataResponse(BaseModel):
|
||||
results: Optional[Any] = Field(default_factory=dict)
|
||||
logs: dict[str, Log] = Field(default_factory=dict)
|
||||
logs: dict[str, List[Log] | Log] = Field(default_factory=dict)
|
||||
message: Optional[Any] = Field(default_factory=dict)
|
||||
artifacts: Optional[Any] = Field(default_factory=dict)
|
||||
timedelta: Optional[float] = None
|
||||
|
|
|
|||
|
|
@ -13,7 +13,12 @@
|
|||
"targetHandle": {
|
||||
"fieldName": "reference_2",
|
||||
"id": "Prompt-Rse03",
|
||||
"inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"BaseOutputParser",
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -34,12 +39,17 @@
|
|||
"dataType": "OpenAIModel",
|
||||
"id": "OpenAIModel-gi29P",
|
||||
"name": "text_output",
|
||||
"output_types": ["Text"]
|
||||
"output_types": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "ChatOutput-JPlxl",
|
||||
"inputTypes": ["Text", "Message"],
|
||||
"inputTypes": [
|
||||
"Text",
|
||||
"Message"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -64,7 +74,12 @@
|
|||
"targetHandle": {
|
||||
"fieldName": "reference_1",
|
||||
"id": "Prompt-Rse03",
|
||||
"inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"BaseOutputParser",
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -84,12 +99,19 @@
|
|||
"dataType": "TextInput",
|
||||
"id": "TextInput-og8Or",
|
||||
"name": "Text",
|
||||
"output_types": ["Text"]
|
||||
"output_types": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "instructions",
|
||||
"id": "Prompt-Rse03",
|
||||
"inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"BaseOutputParser",
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -109,12 +131,18 @@
|
|||
"dataType": "Prompt",
|
||||
"id": "Prompt-Rse03",
|
||||
"name": "prompt",
|
||||
"output_types": ["Prompt"]
|
||||
"output_types": [
|
||||
"Prompt"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "OpenAIModel-gi29P",
|
||||
"inputTypes": ["Text", "Data", "Prompt"],
|
||||
"inputTypes": [
|
||||
"Text",
|
||||
"Data",
|
||||
"Prompt"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -136,10 +164,18 @@
|
|||
"display_name": "Prompt",
|
||||
"id": "Prompt-Rse03",
|
||||
"node": {
|
||||
"base_classes": ["object", "Text", "str"],
|
||||
"base_classes": [
|
||||
"object",
|
||||
"Text",
|
||||
"str"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"template": ["reference_1", "reference_2", "instructions"]
|
||||
"template": [
|
||||
"reference_1",
|
||||
"reference_2",
|
||||
"instructions"
|
||||
]
|
||||
},
|
||||
"description": "Create a prompt template with dynamic variables.",
|
||||
"display_name": "Prompt",
|
||||
|
|
@ -162,7 +198,9 @@
|
|||
"method": "build_prompt",
|
||||
"name": "prompt",
|
||||
"selected": "Prompt",
|
||||
"types": ["Prompt"],
|
||||
"types": [
|
||||
"Prompt"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
},
|
||||
{
|
||||
|
|
@ -171,7 +209,9 @@
|
|||
"method": "format_prompt",
|
||||
"name": "text",
|
||||
"selected": "Text",
|
||||
"types": ["Text"],
|
||||
"types": [
|
||||
"Text"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -280,7 +320,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -316,7 +358,9 @@
|
|||
"data": {
|
||||
"id": "URL-HYPkR",
|
||||
"node": {
|
||||
"base_classes": ["Record"],
|
||||
"base_classes": [
|
||||
"Record"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"urls": null
|
||||
|
|
@ -328,16 +372,20 @@
|
|||
"field_order": [],
|
||||
"frozen": false,
|
||||
"icon": "layout-template",
|
||||
"output_types": ["Data"],
|
||||
"output_types": [
|
||||
"Data"
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"cache": true,
|
||||
"display_name": "Data",
|
||||
"hide": null,
|
||||
"hidden": null,
|
||||
"method": null,
|
||||
"name": "data",
|
||||
"selected": "Data",
|
||||
"types": ["Data"],
|
||||
"types": [
|
||||
"Data"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -368,7 +416,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -406,7 +456,12 @@
|
|||
"data": {
|
||||
"id": "ChatOutput-JPlxl",
|
||||
"node": {
|
||||
"base_classes": ["Text", "Record", "object", "str"],
|
||||
"base_classes": [
|
||||
"Text",
|
||||
"Record",
|
||||
"object",
|
||||
"str"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
|
|
@ -431,7 +486,9 @@
|
|||
"method": "text_response",
|
||||
"name": "text",
|
||||
"selected": "Text",
|
||||
"types": ["Text"],
|
||||
"types": [
|
||||
"Text"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
},
|
||||
{
|
||||
|
|
@ -440,7 +497,9 @@
|
|||
"method": "message_response",
|
||||
"name": "message",
|
||||
"selected": "Message",
|
||||
"types": ["Message"],
|
||||
"types": [
|
||||
"Message"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -471,7 +530,10 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Message to be passed as output.",
|
||||
"input_types": ["Text", "Message"],
|
||||
"input_types": [
|
||||
"Text",
|
||||
"Message"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
|
|
@ -491,12 +553,17 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Type of sender.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
"name": "sender",
|
||||
"options": ["Machine", "User"],
|
||||
"options": [
|
||||
"Machine",
|
||||
"User"
|
||||
],
|
||||
"password": false,
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
|
|
@ -512,7 +579,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Name of the sender.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -532,7 +601,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Session ID for the message.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -563,7 +634,11 @@
|
|||
"data": {
|
||||
"id": "OpenAIModel-gi29P",
|
||||
"node": {
|
||||
"base_classes": ["str", "Text", "object"],
|
||||
"base_classes": [
|
||||
"str",
|
||||
"Text",
|
||||
"object"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
|
|
@ -601,7 +676,9 @@
|
|||
"method": "text_response",
|
||||
"name": "text_output",
|
||||
"selected": "Text",
|
||||
"types": ["Text"],
|
||||
"types": [
|
||||
"Text"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
},
|
||||
{
|
||||
|
|
@ -610,7 +687,9 @@
|
|||
"method": "build_model",
|
||||
"name": "model_output",
|
||||
"selected": "BaseLanguageModel",
|
||||
"types": ["BaseLanguageModel"],
|
||||
"types": [
|
||||
"BaseLanguageModel"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -641,7 +720,11 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text", "Data", "Prompt"],
|
||||
"input_types": [
|
||||
"Text",
|
||||
"Data",
|
||||
"Prompt"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -661,7 +744,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -681,7 +766,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -701,7 +788,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -728,7 +817,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -748,7 +839,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "The OpenAI API Key to use for the OpenAI model.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -768,7 +861,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Stream the response from the model. Streaming works only in Chat.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -788,7 +883,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "System message to pass to the model.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -808,7 +905,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -844,7 +943,9 @@
|
|||
"data": {
|
||||
"id": "URL-2cX90",
|
||||
"node": {
|
||||
"base_classes": ["Record"],
|
||||
"base_classes": [
|
||||
"Record"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"urls": null
|
||||
|
|
@ -856,16 +957,20 @@
|
|||
"field_order": [],
|
||||
"frozen": false,
|
||||
"icon": "layout-template",
|
||||
"output_types": ["Data"],
|
||||
"output_types": [
|
||||
"Data"
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"cache": true,
|
||||
"display_name": "Data",
|
||||
"hide": null,
|
||||
"hidden": null,
|
||||
"method": null,
|
||||
"name": "data",
|
||||
"selected": "Data",
|
||||
"types": ["Data"],
|
||||
"types": [
|
||||
"Data"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -896,7 +1001,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -907,7 +1014,9 @@
|
|||
"show": true,
|
||||
"title_case": false,
|
||||
"type": "str",
|
||||
"value": ["https://www.promptingguide.ai/introduction/basics"]
|
||||
"value": [
|
||||
"https://www.promptingguide.ai/introduction/basics"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -932,7 +1041,11 @@
|
|||
"data": {
|
||||
"id": "TextInput-og8Or",
|
||||
"node": {
|
||||
"base_classes": ["object", "Text", "str"],
|
||||
"base_classes": [
|
||||
"object",
|
||||
"Text",
|
||||
"str"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
|
|
@ -945,12 +1058,16 @@
|
|||
"field_order": [],
|
||||
"frozen": false,
|
||||
"icon": "type",
|
||||
"output_types": ["Text"],
|
||||
"output_types": [
|
||||
"Text"
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "Text",
|
||||
"selected": "Text",
|
||||
"types": ["Text"]
|
||||
"types": [
|
||||
"Text"
|
||||
]
|
||||
}
|
||||
],
|
||||
"template": {
|
||||
|
|
@ -980,7 +1097,10 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Text or Record to be passed as input.",
|
||||
"input_types": ["Record", "Text"],
|
||||
"input_types": [
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -1000,7 +1120,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
|
|
@ -1044,4 +1166,4 @@
|
|||
"is_component": false,
|
||||
"last_tested_version": "1.0.0a0",
|
||||
"name": "Blog Writer"
|
||||
}
|
||||
}
|
||||
|
|
@ -8,12 +8,19 @@
|
|||
"dataType": "MemoryComponent",
|
||||
"id": "MemoryComponent-cdA1J",
|
||||
"name": "text",
|
||||
"output_types": ["Text"]
|
||||
"output_types": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "context",
|
||||
"id": "Prompt-ODkUx",
|
||||
"inputTypes": ["Document", "Message", "Record", "Text"],
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"Message",
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -34,12 +41,19 @@
|
|||
"dataType": "ChatInput",
|
||||
"id": "ChatInput-t7F8v",
|
||||
"name": "message",
|
||||
"output_types": ["Message"]
|
||||
"output_types": [
|
||||
"Message"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "user_message",
|
||||
"id": "Prompt-ODkUx",
|
||||
"inputTypes": ["Document", "Message", "Record", "Text"],
|
||||
"inputTypes": [
|
||||
"Document",
|
||||
"Message",
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -60,12 +74,18 @@
|
|||
"dataType": "Prompt",
|
||||
"id": "Prompt-ODkUx",
|
||||
"name": "prompt",
|
||||
"output_types": ["Prompt"]
|
||||
"output_types": [
|
||||
"Prompt"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "OpenAIModel-9RykF",
|
||||
"inputTypes": ["Text", "Data", "Prompt"],
|
||||
"inputTypes": [
|
||||
"Text",
|
||||
"Data",
|
||||
"Prompt"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -85,12 +105,17 @@
|
|||
"dataType": "OpenAIModel",
|
||||
"id": "OpenAIModel-9RykF",
|
||||
"name": "text_output",
|
||||
"output_types": ["Text"]
|
||||
"output_types": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "ChatOutput-P1jEe",
|
||||
"inputTypes": ["Text", "Message"],
|
||||
"inputTypes": [
|
||||
"Text",
|
||||
"Message"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -110,12 +135,17 @@
|
|||
"dataType": "MemoryComponent",
|
||||
"id": "MemoryComponent-cdA1J",
|
||||
"name": "text",
|
||||
"output_types": ["Text"]
|
||||
"output_types": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"targetHandle": {
|
||||
"fieldName": "input_value",
|
||||
"id": "TextOutput-vrs6T",
|
||||
"inputTypes": ["Record", "Text"],
|
||||
"inputTypes": [
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"type": "str"
|
||||
}
|
||||
},
|
||||
|
|
@ -134,7 +164,12 @@
|
|||
"data": {
|
||||
"id": "ChatInput-t7F8v",
|
||||
"node": {
|
||||
"base_classes": ["Text", "object", "Record", "str"],
|
||||
"base_classes": [
|
||||
"Text",
|
||||
"object",
|
||||
"Record",
|
||||
"str"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
|
|
@ -158,7 +193,9 @@
|
|||
"method": "message_response",
|
||||
"name": "message",
|
||||
"selected": "Message",
|
||||
"types": ["Message"],
|
||||
"types": [
|
||||
"Message"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -209,12 +246,17 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Type of sender.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
"name": "sender",
|
||||
"options": ["Machine", "User"],
|
||||
"options": [
|
||||
"Machine",
|
||||
"User"
|
||||
],
|
||||
"password": false,
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
|
|
@ -230,7 +272,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Name of the sender.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -250,7 +294,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Session ID for the message.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -286,7 +332,12 @@
|
|||
"data": {
|
||||
"id": "ChatOutput-P1jEe",
|
||||
"node": {
|
||||
"base_classes": ["Text", "object", "Record", "str"],
|
||||
"base_classes": [
|
||||
"Text",
|
||||
"object",
|
||||
"Record",
|
||||
"str"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
|
|
@ -310,7 +361,9 @@
|
|||
"method": "text_response",
|
||||
"name": "text",
|
||||
"selected": "Text",
|
||||
"types": ["Text"],
|
||||
"types": [
|
||||
"Text"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
},
|
||||
{
|
||||
|
|
@ -319,7 +372,9 @@
|
|||
"method": "message_response",
|
||||
"name": "message",
|
||||
"selected": "Message",
|
||||
"types": ["Message"],
|
||||
"types": [
|
||||
"Message"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -350,7 +405,10 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Message to be passed as output.",
|
||||
"input_types": ["Text", "Message"],
|
||||
"input_types": [
|
||||
"Text",
|
||||
"Message"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
|
|
@ -370,12 +428,17 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Type of sender.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
"name": "sender",
|
||||
"options": ["Machine", "User"],
|
||||
"options": [
|
||||
"Machine",
|
||||
"User"
|
||||
],
|
||||
"password": false,
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
|
|
@ -391,7 +454,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Name of the sender.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -411,7 +476,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Session ID for the message.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -449,7 +516,11 @@
|
|||
"display_name": "Chat Memory",
|
||||
"id": "MemoryComponent-cdA1J",
|
||||
"node": {
|
||||
"base_classes": ["str", "Text", "object"],
|
||||
"base_classes": [
|
||||
"str",
|
||||
"Text",
|
||||
"object"
|
||||
],
|
||||
"beta": true,
|
||||
"custom_fields": {
|
||||
"n_messages": null,
|
||||
|
|
@ -466,16 +537,20 @@
|
|||
"field_order": [],
|
||||
"frozen": false,
|
||||
"icon": "history",
|
||||
"output_types": ["Text"],
|
||||
"output_types": [
|
||||
"Text"
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"cache": true,
|
||||
"display_name": "Text",
|
||||
"hide": null,
|
||||
"hidden": null,
|
||||
"method": null,
|
||||
"name": "text",
|
||||
"selected": "Text",
|
||||
"types": ["Text"],
|
||||
"types": [
|
||||
"Text"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -525,12 +600,17 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Order of the messages.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
"name": "order",
|
||||
"options": ["Ascending", "Descending"],
|
||||
"options": [
|
||||
"Ascending",
|
||||
"Descending"
|
||||
],
|
||||
"password": false,
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
|
|
@ -546,12 +626,18 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
"name": "sender",
|
||||
"options": ["Machine", "User", "Machine and User"],
|
||||
"options": [
|
||||
"Machine",
|
||||
"User",
|
||||
"Machine and User"
|
||||
],
|
||||
"password": false,
|
||||
"placeholder": "",
|
||||
"required": false,
|
||||
|
|
@ -567,7 +653,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -586,7 +674,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Session ID of the chat history.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -624,10 +714,17 @@
|
|||
"display_name": "Prompt",
|
||||
"id": "Prompt-ODkUx",
|
||||
"node": {
|
||||
"base_classes": ["Text", "str", "object"],
|
||||
"base_classes": [
|
||||
"Text",
|
||||
"str",
|
||||
"object"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"template": ["context", "user_message"]
|
||||
"template": [
|
||||
"context",
|
||||
"user_message"
|
||||
]
|
||||
},
|
||||
"description": "Create a prompt template with dynamic variables.",
|
||||
"display_name": "Prompt",
|
||||
|
|
@ -650,7 +747,9 @@
|
|||
"method": "build_prompt",
|
||||
"name": "prompt",
|
||||
"selected": "Prompt",
|
||||
"types": ["Prompt"],
|
||||
"types": [
|
||||
"Prompt"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
},
|
||||
{
|
||||
|
|
@ -659,7 +758,9 @@
|
|||
"method": "format_prompt",
|
||||
"name": "text",
|
||||
"selected": "Text",
|
||||
"types": ["Text"],
|
||||
"types": [
|
||||
"Text"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -691,7 +792,12 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Document", "Message", "Record", "Text"],
|
||||
"input_types": [
|
||||
"Document",
|
||||
"Message",
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
|
|
@ -711,7 +817,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -732,7 +840,12 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Document", "Message", "Record", "Text"],
|
||||
"input_types": [
|
||||
"Document",
|
||||
"Message",
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
|
|
@ -768,7 +881,11 @@
|
|||
"data": {
|
||||
"id": "OpenAIModel-9RykF",
|
||||
"node": {
|
||||
"base_classes": ["str", "object", "Text"],
|
||||
"base_classes": [
|
||||
"str",
|
||||
"object",
|
||||
"Text"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
|
|
@ -806,7 +923,9 @@
|
|||
"method": "text_response",
|
||||
"name": "text_output",
|
||||
"selected": "Text",
|
||||
"types": ["Text"],
|
||||
"types": [
|
||||
"Text"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
},
|
||||
{
|
||||
|
|
@ -815,7 +934,9 @@
|
|||
"method": "build_model",
|
||||
"name": "model_output",
|
||||
"selected": "BaseLanguageModel",
|
||||
"types": ["BaseLanguageModel"],
|
||||
"types": [
|
||||
"BaseLanguageModel"
|
||||
],
|
||||
"value": "__UNDEFINED__"
|
||||
}
|
||||
],
|
||||
|
|
@ -846,7 +967,11 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text", "Data", "Prompt"],
|
||||
"input_types": [
|
||||
"Text",
|
||||
"Data",
|
||||
"Prompt"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -866,7 +991,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "The maximum number of tokens to generate. Set to 0 for unlimited tokens.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -886,7 +1013,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -906,7 +1035,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": true,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -933,7 +1064,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -953,7 +1086,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "The OpenAI API Key to use for the OpenAI model.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -973,7 +1108,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Stream the response from the model. Streaming works only in Chat.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -993,7 +1130,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "System message to pass to the model.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -1013,7 +1152,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -1049,7 +1190,11 @@
|
|||
"data": {
|
||||
"id": "TextOutput-vrs6T",
|
||||
"node": {
|
||||
"base_classes": ["str", "object", "Text"],
|
||||
"base_classes": [
|
||||
"str",
|
||||
"object",
|
||||
"Text"
|
||||
],
|
||||
"beta": false,
|
||||
"custom_fields": {
|
||||
"input_value": null,
|
||||
|
|
@ -1062,7 +1207,9 @@
|
|||
"field_order": [],
|
||||
"frozen": false,
|
||||
"icon": "type",
|
||||
"output_types": ["Text"],
|
||||
"output_types": [
|
||||
"Text"
|
||||
],
|
||||
"template": {
|
||||
"_type": "CustomComponent",
|
||||
"code": {
|
||||
|
|
@ -1090,7 +1237,10 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Text or Record to be passed as output.",
|
||||
"input_types": ["Record", "Text"],
|
||||
"input_types": [
|
||||
"Record",
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": false,
|
||||
|
|
@ -1110,7 +1260,9 @@
|
|||
"fileTypes": [],
|
||||
"file_path": "",
|
||||
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
|
||||
"input_types": ["Text"],
|
||||
"input_types": [
|
||||
"Text"
|
||||
],
|
||||
"list": false,
|
||||
"load_from_db": false,
|
||||
"multiline": true,
|
||||
|
|
@ -1156,4 +1308,4 @@
|
|||
"is_component": false,
|
||||
"last_tested_version": "1.0.0a0",
|
||||
"name": "Memory Chatbot"
|
||||
}
|
||||
}
|
||||
|
|
@ -939,7 +939,7 @@
|
|||
"show": true,
|
||||
"title_case": false,
|
||||
"type": "code",
|
||||
"value": "from langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\nfrom langflow.template import Input, Output\n\n\nclass TextInput(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n\n inputs = [\n Input(\n name=\"input_value\",\n type=str,\n display_name=\"Value\",\n info=\"Text or Data to be passed as input.\",\n input_types=[\"Data\", \"Text\"],\n ),\n Input(\n name=\"data_template\",\n type=str,\n display_name=\"Data Template\",\n multiline=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"text_response\"),\n ]\n\n def text_response(self) -> Text:\n return self.build(input_value=self.input_value, data_template=self.data_template)\n"
|
||||
"value": "from langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\nfrom langflow.inputs import StrInput\nfrom langflow.template import Output\n\n\nclass TextInput(TextComponent):\n display_name = \"Text Input\"\n description = \"Get text inputs from the Playground.\"\n icon = \"type\"\n\n inputs = [\n StrInput(\n name=\"input_value\",\n type=str,\n display_name=\"Value\",\n info=\"Text or Data to be passed as input.\",\n input_types=[\"Data\", \"Text\"],\n ),\n StrInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n multiline=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n advanced=True,\n value=\"{text}\",\n ),\n ]\n outputs = [\n Output(display_name=\"Text\", name=\"text\", method=\"text_response\"),\n ]\n\n def text_response(self) -> Text:\n return self.build(input_value=self.input_value, data_template=self.data_template)\n"
|
||||
},
|
||||
"input_value": {
|
||||
"advanced": false,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -21,16 +21,17 @@ class Log(TypedDict):
|
|||
def build_logs_from_artifacts(artifacts: dict) -> dict:
|
||||
logs = defaultdict(list)
|
||||
for key in artifacts:
|
||||
message = artifacts[key]
|
||||
message = artifacts[key]["raw"]
|
||||
_type = artifacts[key]["type"]
|
||||
|
||||
if not isinstance(message, dict):
|
||||
message = {"message": message}
|
||||
|
||||
if "stream_url" in message and "type" in message:
|
||||
stream_url = StreamURL(location=message["stream_url"])
|
||||
log = Log(message=stream_url, type=message["type"])
|
||||
elif "type" in message:
|
||||
log = Log(message=message, type=message["type"])
|
||||
log = Log(message=stream_url, type=_type)
|
||||
elif _type:
|
||||
log = Log(message=message, type=_type)
|
||||
|
||||
logs[key].append(log)
|
||||
return logs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue