autogen示例二:会思考的LLM

        本实例基于阿里的千问大模型(LLM),通过多代理共同协作,完成对客户的征信报告的信用评估工作,最后输出正式的评估报告pdf。但是目前输出pdf格式的模版还未调整完成,用txt做演示。

    思路:

       1)创建一个风控专家助理(expert)

       2)给风控专家助理配置一个可以独立思考的大脑(expert_shadow),用于协助专家助理思考问题

        3)创建一个用户代理(user_proxy),分配人类的任务

新附上要解析的征信报告pdf内容:

****** 基础信息:

c25cd33e1616434d9cf2359e8f41e80c.png

430784ec6ed44f4c8cb0bb3139b0deaa.png

****** 信贷交易信息:

69a83fb7bd6841d3b1cc2f8be2aa057d.png

db49c875ceae47d0884690217cdd9ff2.png

下面是代码的解析:

一、环境加载

import os
import autogen
from textwrap import dedent

from autogen.cache import Cache
from finrobot.utils import register_keys_from_json
from finrobot.toolkits import register_toolkits
from finrobot.data_source import CrdtRptUtils
#from autogen.agentchat.contrib.capabilities.teachability import Teachability

from finrobot.functional import (
    CreditReportAnalysisUtils,
    IPythonUtils,
    CreditReportLabUtils,
)

二、LLM配置,这选用的是阿里的千问。


config_list = [
    {"model": "qwen2-72b-instruct", 
     "base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
     "api_key": "sxxxxxxxxxxx", 
     "api_type": "ollama"},
]

llm_config = {
    "config_list": config_list,
    "timeout": 120,
    # "temperature": 0 # for debug convenience
    "temperature": 0.3,
}

# 配置工作目录
work_dir = "./report"
os.makedirs(work_dir, exist_ok=True)

三、助理角色配置

system_message = dedent(
    f"""
    角色: 风险评估专家
    语言:中文
    部门: 风险控制
    主要责任: 生成制定针对个人信用风险的分析报告

    角色描述:
    作为一名金融领域的风控管理者,您的专业知识将会被应用于开发定制化的个人信用风险的分析报告,以满足银行领导的风险管理的需求。深入研究个人信用风险数据,以获取有关个人的还款能力和还款意愿的见解并满足最终风险评估的需求。直接与领导接触,收集必要的信息,并根据他们的反馈不断完善报告,这样也可以确保最终产品能够精确地符合他们的期望。

    关键目标:

    分析精度:运用细致的分析能力来解读个人信用风险的数据,识别潜在趋势和异常。
    以客户为中心:根据领导反馈动态定制报告,确保最终分析符合其战略目标。 
    坚持卓越:在报告生成过程中保持最高质量和诚信标准,遵循既定的分析严谨性基准。 
    绩效指标: 分析报告的有效性通过其在提供清晰、可操作的见解方面的效用来衡量。这包括协助银行领导决策,确定是否授信。
    
    当一切都处理完毕后,请回复“TERMINATE”。
    """
)
expert = autogen.AssistantAgent(
    name="Expert_Investor",
    system_message=system_message,
    llm_config=llm_config,
    is_termination_msg=lambda x: x.get("content", "")
    and x.get("content", "").endswith("TERMINATE"),
)
expert_shadow = autogen.AssistantAgent(
    name="Expert_Investor_Shadow",
    system_message=system_message,
    llm_config=llm_config,
)
user_proxy = autogen.UserProxyAgent(
    name="User_Proxy",
    is_termination_msg=lambda x: x.get("content", "")
    and x.get("content", "").endswith("TERMINATE"),
    # human_input_mode="ALWAYS",
    human_input_mode="NEVER",
    # max_consecutive_auto_reply=10,
    code_execution_config={
        "last_n_messages": 1,
        "work_dir": work_dir,
        "use_docker": False,
    },
)

四、工具清单

这里涉及7个工具:

1)数据采集

        CrdtRptUtils.get_bs_info:获取征信报告的“基础信息”,目前是通过解析pdf来获得,正确的做法是获取人行征信的api;

        CrdtRptUtils.get_acc_summary:获取征信报告的“信贷交易信息提示”部分信息,目前是通过解析pdf来获得,正确的做法是获取人行征信的api;

2)数据分析:

        CreditReportAnalysisUtils.analyze_bs_info:负责制定分析“基础信息”的分析计划;

        CreditReportAnalysisUtils.analyze_acc_summary:负责制定分析信贷交易信息提示”的分析计划;

3)报告生成:

        CreditReportLabUtils.recorder_set:记录分析的结果

        CreditReportLabUtils.recorder_get:获取分析的结果

         CreditReportLabUtils.write_string_to_txt:定义生成评估报告的模版,最后一个应用的工具

        如果是gpt4模型,以上两个工具(recorder_set、recorder_get)是多余,因它模型可以根据分析步骤一步一步的完成。但是当使用不太“智能”的模型时候,当代码执行到后面,就容易忘记前面的分析结果。导致到最后报告汇总的时候,提供的信息都是错误的。因此,通过一个函数记录当时分析的结果,一个函数获取指定的分析结果信息,来规避这个问题。个人也觉得,这个方式在处理复杂的任务时候,也是比较好的思路。

工具示例CreditReportAnalysisUtils.analyze_acc_summary:

def analyze_acc_summary(
        cst_name: Annotated[str, "customer's name"],
        crdt_id: Annotated[str, "身份证件号码"],
        save_path: Annotated[str, "txt file path, to which the returned instruction & resources are written."]
    ) -> str:
        """
        Then return with an instruction on how to analyze the credit's transaction information.
        """
        #检索客户的信贷交易信息,然后返回如何总结信贷交易信息的指导方法
        # 检索客户 信贷交易信息提示
        Retrieve_sms = CrdtRptUtils.get_acc_summary(cst_name=cst_name,crdt_id=crdt_id)
        #df_string = "Income statement:\n" + income_stmt.to_string().strip()

        # Analysis instruction
        instruction = dedent(
        """
        根据上文 Resource 给出的信息,遵照以下思路进行总结:
        - 统计贷款、贷记卡及其他贷款的账户数。账户数量较多,表明其信贷活动频繁,可能面临较大的还款压力。
        - 首笔业务发放月份越早,说明具有长期的信贷历史。
        - 存在逾期、呆账或者被追偿记录的情况,说明信用不好。
        最终,总结成一段100字左右的简要总结概述,概述的论述要有数据支持。

        Save:
            请使用recorder_set工具将分析结果存储下来,工具的参数key='B'。
        """
        )
        # Retrieve the related section from the 10-K report
        #section_text = SECUtils.get_10k_section(ticker_symbol, fyear, 7)
        prompt = combine_prompt(instruction, Retrieve_sms)
        save_to_file(prompt, save_path)
        print(f"instruction & resources saved to {save_path}")
        
        return f"instruction & resources saved to {save_path}"

四、给助理分配工具(注册)

register_toolkits(
    [
        CreditReportAnalysisUtils, 
        CreditReportLabUtils.recorder_get, 
        CreditReportLabUtils.write_string_to_txt, 
    ],
    expert,
    user_proxy,
)

register_toolkits(
    [
        CreditReportLabUtils.recorder_set,  # 给影子一个存储分析结果的工具
    ],
    expert_shadow,
    expert,
)

五、定义启动专家助理与大脑思考的条件,既嵌套聊天的触发条件

def order_trigger(sender):
    # Check if the last message contains the path to the instruction text file
    print(f">>>>>>>>>>>>>>>order_trigger")
    return "instruction & resources saved to" in sender.last_message()["content"]
    

def order_message(recipient, messages, sender, config):
    # Extract the path to the instruction text file from the last message
    full_order = recipient.chat_messages_for_summary(sender)[-1]["content"]
    print(f">>>>>>>>>>>>>>>{full_order}")
    txt_path = full_order.replace("instruction & resources saved to ", "").strip()
    print(f">>>>>>>>>>>>{txt_path}")
    with open(txt_path, "r") as f:
        instruction = f.read() + "\n\nReply TERMINATE at the end of your response."
    return instruction


# Since 10-K section is not short, we need an extra nested chat to analyze the contents
expert.register_nested_chats(
    [
        {
            "sender": expert,
            "recipient": expert_shadow,
            "message": order_message,
            "summary_method": "last_msg",
            "max_turns": 3,
            #"silent": True,  # mute the chat summary
        }
    ],
    trigger=order_trigger,
)

六、任务启动

cst_name = "张十五"
crdt_id = "110108******181X"
report_day = "2024-07-31"

task = dedent(
    f"""
    使用你已获得的工具,采用信用风险评估报告的格式,写一份关于客户名称:{cst_name},身份证件号码:{crdt_id}的征信的分析报告。
    请注意以下几点:
    * 所有交流必须用中文表达。
    * 在开始工作前,明确地说明你的工作计划。
    * 为了清晰起见,逐一使用工具,特别是在请求指导时。需要提醒你,每个工具只能使用一次。
    * 所有文件操作都应在"{work_dir}"目录下进行。
    * 一旦生成任何图像,就在聊天中展示出来。
    * 等所有的任务已经完成后,才生成txt文档。
    """
)

with Cache.disk() as cache:
    user_proxy.initiate_chat(
        recipient=expert, message=task, max_turns=50, summary_method="last_msg"
    )

7、最后生成的基于征信报告的信用评估报告

30dbcad1ee714d74a02643ff6ab8129e.png

*************  征信信用风险评估报告:张十五  *************

--客户基本信息--
张十五,男,现年42岁,已婚,有稳定家庭生活,目前在职,显示有稳定就业。他拥有本科及学士学位,表明具有良好的教育背景。张十五曾就职于多个知名企事业单位,如中国人民银行征信中心、北京大学、中科院微电子研究所等,工作单位性质涵盖机关、事业单位及外资企业,行业涉及金融业、科学研究和技术服务业,担任过中级领导及一般员工职务,拥有中级及初级职称,显示出其职业生涯的多样性与稳定性。自2001年起,他在不同单位任职,显示了职业发展的连贯性和上升空间。居住信息显示,张十五在多个地点有过居住记录,但最近的居住地址为北京市朝阳区春晓园北区7号楼C555室,表明有稳定的居住环境。总体来看,张十五具有稳定的生活和工作状态,所从事行业就业前景良好,且有稳定的收入来源和职业上升空间。
--信贷交易信息--
根据资源中的数据,该个人共有11个贷款账户,包括个人住房、商用房和其他类贷款,显示其信贷活动频繁,可能承受较大还款压力。自2007年9月起,已有长达15年的信贷历史。然而,存在3个逾期账户,最长逾期月数达4个月,单月最高逾期总额5,500元;1个呆账账户,余额170,000元;以及2个被追偿账户,余额总计30,000元,反映出其信用状况不佳。此外,有4个贷记卡账户,总授信额80,000元,已用额度15,000元,平均每月使用额度4,000元,表明信用卡使用情况适中。
--授信建议--
综合考虑张十五的稳定生活和工作状态,以及信贷活动频繁但信用状况不佳的情况,建议审慎授信,加强贷后监控。

 

运行日志:

User_Proxy (to Expert_Investor):


使用你已获得的工具,采用信用风险评估报告的格式,写一份关于客户名称:张十五,身份证件号码:110108******181X的征信的分析报告。
请注意以下几点:
* 所有交流必须用中文表达。
* 在开始工作前,明确地说明你的工作计划。
* 为了清晰起见,逐一使用工具,特别是在请求指导时。需要提醒你,每个工具只能使用一次。
* 所有文件操作都应在"./report"目录下进行。
* 一旦生成任何图像,就在聊天中展示出来。
* 等所有的任务已经完成后,才生成txt文档。


--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger
Expert_Investor (to User_Proxy):

我的工作计划如下:

1. 使用`analyze_bs_info`函数,从信用报告中提取张十五的基础信息,并总结。
2. 使用`analyze_acc_summary`函数,分析张十五的信贷交易信息。
3. 将上述两个步骤得到的结果存入记录员,分别用键值"A"和"B"保存。
4. 从记录员中读取这两个总结,整合成一份完整的信用风险评估报告。
5. 最后,使用`write_string_to_txt`函数,将这份报告写入一个txt文件中,存储于"./report"目录下。

现在我将开始执行第一步,调用`analyze_bs_info`函数。
***** Suggested tool call (call_59bf831494924ee78d2ccd): analyze_bs_info *****
Arguments: 
{"cst_name": "张十五", "crdt_id": "110108******181X", "save_path": "./report/张十五_基本总结.txt"}
******************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION analyze_bs_info...

Got stderr: 8月 14, 2024 9:19:31 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:31 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:31 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'Arial-BoldMT'
8月 14, 2024 9:19:32 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:32 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:32 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'Arial-BoldMT'
8月 14, 2024 9:19:32 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:32 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:33 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:34 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:34 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:35 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:35 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:35 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:35 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:36 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:36 下午 org.apache.fontbox.ttf.CmapSubtable processSubtype14
警告: Format 14 cmap table is not supported and will be ignored
8月 14, 2024 9:19:36 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'ArialMT'
8月 14, 2024 9:19:36 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:36 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:36 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'ArialMT'
8月 14, 2024 9:19:36 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'

征信报告读取成功.
instruction & resources saved to ./report/张十五_基本总结.txt
User_Proxy (to Expert_Investor):

User_Proxy (to Expert_Investor):

***** Response from calling tool (call_59bf831494924ee78d2ccd) *****
instruction & resources saved to ./report/张十五_基本总结.txt
********************************************************************

--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>instruction & resources saved to ./report/张十五_基本总结.txt
>>>>>>>>>>>>./report/张十五_基本总结.txt
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger

>>>>>>>> EXECUTING FUNCTION recorder_set...
Expert_Investor (to User_Proxy):



--------------------------------------------------------------------------------
User_Proxy (to Expert_Investor):



--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger
Expert_Investor (to User_Proxy):

基础信息的总结已保存至`./report/张十五_基本总结.txt`。

接下来,我将执行第二步,调用`analyze_acc_summary`函数来分析张十五的信贷交易信息。
***** Suggested tool call (call_32717f76aa1943088f4243): analyze_acc_summary *****
Arguments: 
{"cst_name": "张十五", "crdt_id": "110108******181X", "save_path": "./report/张十五_信贷总结.txt"}
**********************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION analyze_acc_summary...

Got stderr: 8月 14, 2024 9:19:37 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:37 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:37 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'Arial-BoldMT'
8月 14, 2024 9:19:38 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:38 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:38 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'Arial-BoldMT'
8月 14, 2024 9:19:38 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:39 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:39 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:40 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:40 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:41 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:41 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:41 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:41 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:42 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:42 下午 org.apache.fontbox.ttf.CmapSubtable processSubtype14
警告: Format 14 cmap table is not supported and will be ignored
8月 14, 2024 9:19:42 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'ArialMT'
8月 14, 2024 9:19:42 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
8月 14, 2024 9:19:42 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
8月 14, 2024 9:19:42 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'ArialMT'
8月 14, 2024 9:19:42 下午 org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
警告: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'

征信报告读取成功.
instruction & resources saved to ./report/张十五_信贷总结.txt
User_Proxy (to Expert_Investor):

User_Proxy (to Expert_Investor):

***** Response from calling tool (call_32717f76aa1943088f4243) *****
instruction & resources saved to ./report/张十五_信贷总结.txt
********************************************************************

--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>instruction & resources saved to ./report/张十五_信贷总结.txt
>>>>>>>>>>>>./report/张十五_信贷总结.txt
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger

>>>>>>>> EXECUTING FUNCTION recorder_set...
Expert_Investor (to User_Proxy):

分析结果已保存。



--------------------------------------------------------------------------------
User_Proxy (to Expert_Investor):



--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger
Expert_Investor (to User_Proxy):

信贷交易信息的总结已保存至`./report/张十五_信贷总结.txt`。

现在,我将执行最后一步,调用`recorder_get`函数来读取我们之前保存的张十五的基础信息总结和信贷交易信息总结。
***** Suggested tool call (call_2517756af4ba4a0b9ebbd0): recorder_get *****
Arguments: 
{"key": "A"}
***************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION recorder_get...
User_Proxy (to Expert_Investor):

User_Proxy (to Expert_Investor):

***** Response from calling tool (call_2517756af4ba4a0b9ebbd0) *****
张十五,男,现年42岁,已婚,有稳定家庭生活,目前在职,显示有稳定就业。他拥有本科及学士学位,表明具有良好的教育背景。张十五曾就职于多个知名企事业单位,如中国人民银行征信中心、北京大学、中科院微电子研究所等,工作单位性质涵盖机关、事业单位及外资企业,行业涉及金融业、科学研究和技术服务业,担任过中级领导及一般员工职务,拥有中级及初级职称,显示出其职业生涯的多样性与稳定性。自2001年起,他在不同单位任职,显示了职业发展的连贯性和上升空间。居住信息显示,张十五在多个地点有过居住记录,但最近的居住地址为北京市朝阳区春晓园北区7号楼C555室,表明有稳定的居住环境。总体来看,张十五具有稳定的生活和工作状态,所从事行业就业前景良好,且有稳定的收入来源和职业上升空间。
********************************************************************

--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger
Expert_Investor (to User_Proxy):


***** Suggested tool call (call_07db4cebd61045628851ab): recorder_get *****
Arguments: 
{"key": "B"}
***************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION recorder_get...
User_Proxy (to Expert_Investor):

User_Proxy (to Expert_Investor):

***** Response from calling tool (call_07db4cebd61045628851ab) *****
根据资源中的数据,该个人共有11个贷款账户,包括个人住房、商用房和其他类贷款,显示其信贷活动频繁,可能承受较大还款压力。自2007年9月起,已有长达15年的信贷历史。然而,存在3个逾期账户,最长逾期月数达4个月,单月最高逾期总额5,500元;1个呆账账户,余额170,000元;以及2个被追偿账户,余额总计30,000元,反映出其信用状况不佳。此外,有4个贷记卡账户,总授信额80,000元,已用额度15,000元,平均每月使用额度4,000元,表明信用卡使用情况适中。
********************************************************************

--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger
Expert_Investor (to User_Proxy):


***** Suggested tool call (call_b9deb476ff7d44b39d43cb): write_string_to_txt *****
Arguments: 
{"cst_name": "张十五", "fin_summary": "综合考虑张十五的稳定生活和工作状态,以及信贷活动频繁但信用状况不佳的情况,建议审慎授信,加强贷后监控。", "save_path": "./report/张十五_信用风险分析报告.txt"}
**********************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION write_string_to_txt...
User_Proxy (to Expert_Investor):

User_Proxy (to Expert_Investor):

***** Response from calling tool (call_b9deb476ff7d44b39d43cb) *****
Annual report generated successfully.
********************************************************************

--------------------------------------------------------------------------------
>>>>>>>>>>>>>>>order_trigger
>>>>>>>>>>>>>>>order_trigger
Expert_Investor (to User_Proxy):

张十五的信用风险分析报告已成功生成,位于`./report/张十五_信用风险分析报告.txt`。

总结:
- 张十五具有稳定的生活和工作状态,所从事行业就业前景良好,且有稳定的收入来源和职业上升空间。
- 然而,他的信贷活动频繁,存在逾期、呆账和被追偿的不良记录,反映出信用状况不佳。
- 基于以上分析,建议对张十五审慎授信,并加强贷后监控。

至此,针对张十五的个人信用风险分析报告已完成,您可以查阅报告以获取更详细的分析结果。如果您有任何疑问或需要进一步的说明,请随时告知。TERMINATE

--------------------------------------------------------------------------------

引用:

1:GitHub - AI4Finance-Foundation/FinRobot: FinRobot: An Open-Source AI Agent Platform for Financial Applications using LLMs 🚀 🚀 🚀

5fa80e336cf84bbd88225412a7500662.webp

 

2:GitHub - microsoft/autogen: A programming framework for agentic AI. Discord: https://aka.ms/autogen-dc. Roadmap: https://aka.ms/autogen-roadmap

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值