following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: Human: こんにちは。 AI: > Finished chain. 'こんにちは!元気ですか?どのようにお手伝いできますか?' 6
following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: Human: こんにちは。 AI: こんにちは!元気ですか?どのようにお手伝いできますか? Human: 今日は晴れです。どのようなタスクができますか? AI: > Finished chain. '私はさまざまなタスクをこなすことができます。例えば、日常生活のアドバイスや情報の提供、予定の管理、翻訳、ニュースの読み 上げ、天気予報の提供などができます。どのようなタスクが必要ですか?' チャット履歴も覚えてくれてますね 7
following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: Human: こんにちは。 AI: /home/ubuntu/workspace/2310-line-slack-bedrock/.venv/lib/python3.10/site- packages/langchain/llms/bedrock.py:50: UserWarning: Error: Prompt must alternate between ' Human:' and ' Assistant:'. Received 10
and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: Human: こんにちは。 AI: Assistant: warnings.warn(ALTERNATION_ERROR + f" Received {input_text}") > Finished chain. ' こんにちは。はじめまして。私は人工知能のアシスタントです。質問があればしっかり答えられるようにベストを尽くしますが、知 識の範囲は限られています。よろしくお願いします。' 回答は返ってきましたが、Warningが出てます。。 11
conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:') なるほど。 17
import ConversationBufferMemory from langchain.prompts import PromptTemplate prompt_template = PromptTemplate( input_variables=['history', 'input'], template='''The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: <history> {history} </history> {input}''' ) 19
following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: <history> </history> こんにちは。 > Finished chain. ' はい、こんにちは。私はAIアシスタントです。名前は何ですか。' 21
following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: <history> H: こんにちは。 A: はい、こんにちは。私はAIアシスタントです。名前は何ですか。 </history> 今日は晴れです。どのようなタスクができますか? > Finished chain. ' はい、今日は晴れそうですね。私は Claude という名前の Chatbot です。\n\n私には特定のタスクを実行する能力はありませ んが、ユーザーと会話を行うことができます。質問に答えたり、興味のあるトピックについて話したりすることができます。どのよう な話題が興味深いか教えてください。私にとって最善の「タスク」は、ユーザーと可能な限り有益な対話を行うことだと思います。' 22
from langchain.memory import ConversationBufferWindowMemory from langchain.memory.chat_message_histories import DynamoDBChatMessageHistory from langchain.prompts import PromptTemplate prompt_template = PromptTemplate( input_variables=['history', 'input'], template='''The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: <history> {history} </history> {input}''' ) 28
signature = event['headers']['x-line-signature'] # get request body as text body = event['body'] line_handler.handle(body,signature) return { 'statusCode': 200, 'body': 'OK' } 41