input_tool = akasha.create_tool( "user_question_tool", "This is the tool to ask user question, the only one param question is the question string that has not been answered and we want to ask user.", func=input_func)
ao = akasha.test_agent( verbose=True, tools=[input_tool, akasha.get_saveJSON_tool(), akasha.get_wiki_tool()], retri_observation=True, model="openai:gpt-3.5-turbo") st = ao.stream("請用中文回答李遠哲跟黃仁勳誰比較老?將查到的資訊和答案儲存成json檔案,檔名為AGE.json") for s in st: print(s)
test_agent 中的所有參數:
1 2 3 4 5 6 7 8 9 10 11 12
Args: model (str, optional): 使用的大語言模型. Defaults to "gpt-3.5-turbo".\n verbose (bool, optional): 是否顯示log文字. Defaults to False.\n language (str, optional): 用來計算文字長度(max_doc_len)的語言. Defaults to "zh" temperature (float, optional): 大語言模型的temperature(0.0 ~ 1.0) . Defaults to 0.0.\n keep_logs (bool, optional)**: 是否紀錄執行的log. Defaults to False.\n max_round (int, optional)**: agent最多執行次數,超過即跳出,避免無線迴圈. Defaults to 20.\n max_input_tokens (int, optional): agent保留的之前做過的思考與動作的文字最大長度. Defaults to 3200.\n max_past_observation (int, optional)**: agent保留的之前做過的思考與動作的最多次數. Defaults to 10.\n retri_observation (bool, optional)**: 若設為True, agent會利用大語言模型去擷取tool回傳內容,避免多餘文字輸入. Defaults to False.\n