Closed xueyayang closed 1 month ago
python --version看一下呢。pydantic有issue提到python 3.9.7有可能会报这个问题:https://github.com/pydantic/pydantic/issues/7544
python --version看一下呢。pydantic有issue提到python 3.9.7有可能会报这个问题:pydantic/pydantic#7544
c:\Python39>python --version Python 3.9.7
使用的是3.9.7. 升级3.12 后好了。谢谢。
c:\XueTest\QianFan>python --version Python 3.12.4
c:\XueTest\QianFan>python test.py answer='中国的首都是北京。\n\n北京的春季天气舒适,气温适中,雨水较少,适合出行^[1]^。\n\n北京春季适合玩的景点有很多 ,以下为您推荐:\n\n 天坛公园:了解古代皇帝祭祀的神圣场所^[1]^。\n 颐和园:欣赏皇家园林的瑰丽风光^[1]^。\n 圆明园:感受历史事件的震撼,见证遗址的独特魅力^[1]^。\n 南锣鼓巷:品味老北京的风土人情,感受独特的胡同文化^[1]^。\n 故宫博物院:城墙建筑,院落布局,都包含了古代人民的巧夺天工^[1]^。\n\n此外,还有八达岭长城、中国国家博物馆、国家 大剧院、北京环球度假区等著名景点,您可以根据自己的兴趣选择游玩地^[1]^。' events=[Event(code=0, message='', status='done', event_type='function_call', content_type='function_call', detail={'text': {'arguments': {'origin_query': '中国的首都在哪里?春季天气怎么样?有什么适合玩的景点?'}, 'component_code': 'RAGAgent', 'component_name': '知识问答'}}, usage=None), Event(code=0, message='', status='preparing', event_type='RAGAgent', content_type='status', detail={}, usage=None), Event(code=0, message='', status='done', event_type='RAGAgent', content_type='rag', detail={'name_cn': '网页搜索', 'references': [{'id': '1', 'content': '到北京旅游什么季节最好,北京必游景点,小...', 'type': 'web', 'from': 'search_baidu', 'title': '到北京旅游什么季节最好,北京必游景点,小白可直接冲!', 'url': 'https://baijiahao.baidu.com/s?id=1793663827757997486&wfr=spider&for=pc', 'resource_type': 'web'}, {'id': '2', 'content': ' 总之,三月份的北京是一个充满魅力的地方...', 'type': 'web', 'from': 'search_baidu', 'title': '春季来临,北京的魅力之旅', 'url': 'https://haokan.baidu.com/v?pd=wisenatural&vid=8205375580422526429', 'resource_type': 'video', 'video_url': 'https://vd3.bdstatic.com/mda-qdhfndq1px2k6ar4/hd/cae_h264/1713482096386312473/mda-qdhfndq1px2k6ar4.mp4'}], 'text': ''}, usage=None), Event(code=0, message='', status='done', event_type='RAGAgent', content_type='rag', detail={'name_cn': '网页搜索', 'text': '中国的首都是北京。\n\n北京的春季天气舒适,气温适中,雨水较少,适合出行^[1]^。\n\n北京春季适合玩的景点有很多,以下为您推荐:\n\n 天坛公园:了解古代皇帝 祭祀的神圣场所^[1]^。\n 颐和园:欣赏皇家园林的瑰丽风光^[1]^。\n 圆明园:感受历史事件的震撼,见证遗址的独特魅力^[1]^。\n 南锣鼓巷:品味老北京的风土人情,感受独特的胡同文化^[1]^。\n 故宫博物院:城墙建筑,院落布局,都包含了古代人民的巧夺天工^[1]^。\n\n此外,还有八达岭长城、中国国家博物馆、国家大剧院、北京环球度假区等著名景点,您可以根据自己 的兴趣选择游玩地^[1]^。', 'references': []}, usage=Usage(prompt_tokens=1084, completion_tokens=171, total_tokens=1255, name='ERNIE-4.0-8K')), Event(code=0, message='', status='success', event_type='RAGAgent', content_type='status', detail={}, usage=None)]
输出: