mirror of
https://github.com/agentuniverse-ai/agentUniverse.git
synced 2026-02-09 01:59:19 +08:00
27 lines
916 B
Python
27 lines
916 B
Python
# !/usr/bin/env python3
|
|
# -*- coding:utf-8 -*-
|
|
|
|
# @Time : 2024/10/24 21:19
|
|
# @Author : wangchongshi
|
|
# @Email : wangchongshi.wcs@antgroup.com
|
|
# @FileName: default_summarize_agent_template.py
|
|
from agentuniverse.agent.input_object import InputObject
|
|
from agentuniverse.agent.template.rag_agent_template import RagAgentTemplate
|
|
|
|
|
|
class SummarizeRagAgentTemplate(RagAgentTemplate):
|
|
|
|
def input_keys(self) -> list[str]:
|
|
return ['input', 'summarize_content']
|
|
|
|
def output_keys(self) -> list[str]:
|
|
return ['output']
|
|
|
|
def parse_input(self, input_object: InputObject, agent_input: dict) -> dict:
|
|
agent_input['input'] = input_object.get_data('input')
|
|
agent_input['summarize_content'] = input_object.get_data('summarize_content')
|
|
return agent_input
|
|
|
|
def parse_result(self, agent_result: dict) -> dict:
|
|
return {**agent_result, 'output': agent_result['output']}
|