chore: Add trace_type attribute to LCModelComponent
This commit is contained in:
parent
2f04ac3e44
commit
25b4f94b33
1 changed files with 4 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ from langflow.template.field.base import Output
|
||||||
class LCModelComponent(Component):
|
class LCModelComponent(Component):
|
||||||
display_name: str = "Model Name"
|
display_name: str = "Model Name"
|
||||||
description: str = "Model Description"
|
description: str = "Model Description"
|
||||||
|
trace_type = "llm"
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
Output(display_name="Text", name="text_output", method="text_response"),
|
Output(display_name="Text", name="text_output", method="text_response"),
|
||||||
|
|
@ -138,6 +139,9 @@ class LCModelComponent(Component):
|
||||||
messages.append(HumanMessage(content=input_value))
|
messages.append(HumanMessage(content=input_value))
|
||||||
inputs: Union[list, dict] = messages or {}
|
inputs: Union[list, dict] = messages or {}
|
||||||
try:
|
try:
|
||||||
|
runnable = runnable.with_config(
|
||||||
|
{"run_name": self.display_name, "project_name": self.tracing_service.project_name}
|
||||||
|
)
|
||||||
if stream:
|
if stream:
|
||||||
return runnable.stream(inputs)
|
return runnable.stream(inputs)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue