wangyl96
wangyl96
Below, I will provide you with the DIY source code for constructing prompt words for two applications: chat assistant and agent. You will find that only the chat assistant supports...
Chat assistant application retrieves knowledge base code location: api/core/app/apps/chat/app_runner.py:161 ``` if app_config.dataset and app_config.dataset.dataset_ids: hit_callback = DatasetIndexToolCallbackHandler( queue_manager, app_record.id, message.id, application_generate_entity.user_id, application_generate_entity.invoke_from, ) dataset_retrieval = DatasetRetrieval(application_generate_entity) context = dataset_retrieval.retrieve( app_id=app_record.id,...
The agent application only retrieves relevant code from external knowledge bases: ``` # fill in variable inputs from external data tools if exists external_data_tools = app_config.external_data_variables if external_data_tools: inputs =...
 Is the code for calculating the length of this text correct Should be changed to length_function: Callable[[list[str]], list[int]] = lambda x: [len(y) for y in x]