Replies: 4 comments 2 replies
-
Hey @azaidiuk! I'm here to help you with any issues or questions you have. I'm a bot designed to assist with bug fixes, answer questions, and guide you on becoming a contributor. Let me know how I can assist you! The For use cases previously handled by class ProcessResponse(BaseModel):
"""Process response schema."""
result: Any
status: Optional[str] = None
task: Optional[TaskResponse] = None
session_id: Optional[str] = None
backend: Optional[str] = None Additionally, the class RunResponse(BaseModel):
"""Run response schema."""
outputs: Optional[List[RunOutputs]] = []
session_id: Optional[str] = None
@model_serializer(mode="plain")
def serialize(self):
# Serialize all the outputs if they are base models
serialized = {"session_id": self.session_id, "outputs": []}
if self.outputs:
serialized_outputs = []
for output in self.outputs:
if isinstance(output, BaseModel) and not isinstance(output, RunOutputs):
serialized_outputs.append(output.model_dump(exclude_none=True))
else:
serialized_outputs.append(output)
serialized["outputs"] = serialized_outputs
return serialized For more specific use cases, you might also consider other schemas such as |
Beta Was this translation helpful? Give feedback.
-
Subflow is not working – the dropdown to select a workflow is not populating
From: dosubot[bot] ***@***.***>
Date: Tuesday, 18 June 2024 at 12:45
To: langflow-ai/langflow ***@***.***>
Cc: azaidiuk ***@***.***>, Mention ***@***.***>
Subject: Re: [langflow-ai/langflow] ResponseSchema in latest build (Discussion #2209)
Hey @azaidiuk<https://github.com/azaidiuk>! I'm here to help you with any issues or questions you have. I'm a bot designed to assist with bug fixes, answer questions, and guide you on becoming a contributor. Let me know how I can assist you!
The ResponseSchema has been replaced by several new schemas in the latest build. Notable alternatives include ProcessResponse and RunResponse, among others.
For use cases previously handled by ResponseSchema, the ProcessResponse schema is recommended:
class ProcessResponse(BaseModel):
"""Process response schema."""
result: Any
status: Optional[str] = None
task: Optional[TaskResponse] = None
session_id: Optional[str] = None
backend: Optional[str] = None
Additionally, the RunResponse schema can be used if your use case involves handling outputs from a run session:
class RunResponse(BaseModel):
"""Run response schema."""
outputs: Optional[List[RunOutputs]] = []
session_id: Optional[str] = None
@model_serializer(mode="plain")
def serialize(self):
# Serialize all the outputs if they are base models
serialized = {"session_id": self.session_id, "outputs": []}
if self.outputs:
serialized_outputs = []
for output in self.outputs:
if isinstance(output, BaseModel) and not isinstance(output, RunOutputs):
serialized_outputs.append(output.model_dump(exclude_none=True))
else:
serialized_outputs.append(output)
serialized["outputs"] = serialized_outputs
return serialized
For more specific use cases, you might also consider other schemas such as PreloadResponse, TaskStatusResponse, ChatResponse, PromptResponse, FileResponse, and others [1]<https://github.com/logspace-ai/langflow/blob/dev/src/backend/langflow/api/v1/schemas.py>[2]<https://github.com/logspace-ai/langflow/blob/dev/src/backend/base/langflow/api/v1/schemas.py>.
To continue talking to Dosu<https://dosu.dev>, mention @dosu<https://github.com/dosu>.
—
Reply to this email directly, view it on GitHub<#2209 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJIB6Y7DZYUNHSBNTRNLTKLZIAMUBAVCNFSM6AAAAABJP3D3Z2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQMBVGQYTM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I am getting and error trace stating list is not supported from
get_flow_names
…On Tue, 16 Jul 2024 at 00:07, dosubot[bot] ***@***.***> wrote:
The dropdown to select a workflow in the subflow feature is not populating
because the options field for flow_name in the build_config is not being
updated correctly. The update_build_config method is responsible for
updating the options field with the available flow names by calling
self.get_flow_names(). If this method is not being called or if
self.get_flow_names() is not returning any flow names, the dropdown will
remain empty.
Ensure that self.get_flow_names() is correctly implemented and returning
a list of flow names. If self.list_flows() is not returning any flows,
the dropdown will not populate. Here is the implementation of
self.get_flow_names():
def get_flow_names(self) -> List[str]:
flow_datas = self.list_flows()
return [flow_data.data["name"] for flow_data in flow_datas]
Make sure that self.list_flows() is functioning correctly and returning
the available flows. If there are no flows available, the dropdown will
remain empty [1]
<https://github.com/langflow-ai/langflow/blob/dev/src/backend/base/langflow/components/experimental/SubFlow.py>
[2]
<https://github.com/langflow-ai/langflow/blob/dev/src/backend/base/langflow/components/prototypes/SubFlow.py>
[3]
<https://github.com/langflow-ai/langflow/blob/dev/src/backend/base/langflow/components/deactivated/SubFlow.py>
.
*To continue talking to Dosu <https://dosu.dev>, mention @dosu
<https://github.com/dosu>.*
—
Reply to this email directly, view it on GitHub
<#2209 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIB6Y3I7X7ZMNI5PID3X6LZMRI2HAVCNFSM6AAAAABJP3D3Z2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMBVGYYTQMY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi! 👋 We are using other channels as our official means of communication with users. We apologize for the delayed response. Thank you for your understanding. Best regards, |
Beta Was this translation helpful? Give feedback.
-
I am looking for responseschema in the latest build, has this moved or not implemented yet ?
Beta Was this translation helpful? Give feedback.
All reactions