Fix: add download stats to kb logs. (#11112)

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-11-10 13:28:07 +08:00
committed by GitHub
parent bf382e5c4d
commit d207291217
12 changed files with 50 additions and 15 deletions

View File

@ -457,7 +457,7 @@ class Canvas(Graph):
if o.component_name.lower() == "userfillup":
another_inputs.update(o.get_input_elements())
if o.get_param("enable_tips"):
tips = o.get_param("tips")
tips = o.output("tips")
self.path = path
yield decorate("user_inputs", {"inputs": another_inputs, "tips": tips})
return

View File

@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import logging
import os
import importlib
import inspect
@ -53,7 +52,7 @@ def component_class(class_name):
for module_name in ["agent.component", "agent.tools", "rag.flow"]:
try:
return getattr(importlib.import_module(module_name), class_name)
except Exception as e:
logging.warning(f"Can't import module: {module_name}, error: {e}")
except Exception:
# logging.warning(f"Can't import module: {module_name}, error: {e}")
pass
assert False, f"Can't import {class_name}"

View File

@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from agent.component.base import ComponentBase, ComponentParamBase
from agent.component.message import MessageParam, Message
class UserFillUpParam(ComponentParamBase):
class UserFillUpParam(MessageParam):
def __init__(self):
super().__init__()
@ -27,10 +27,13 @@ class UserFillUpParam(ComponentParamBase):
return True
class UserFillUp(ComponentBase):
class UserFillUp(Message):
component_name = "UserFillUp"
def _invoke(self, **kwargs):
if self._param.enable_tips:
tips, kwargs = self.get_kwargs(self._param.tips)
self.set_output("tips", tips)
for k, v in kwargs.get("inputs", {}).items():
self.set_output(k, v)