こんにちは。
先日まで、Bedrock APIでDeepSeek-R1の回答に問題はなかったのですが、
今日確認したところ、次のようにAPIの回答の先頭の文字が欠落するようになりました。
メッセージ例:
hello
回答例:
んにちは!どのようなご用件でしょうか?
...
その時のjsonログは、次のようになっています。
{
"timestamp": "2025-08-20T07:25:36Z",
"accountId": "****",
"identity": {
"arn": "****"
},
"region": "us-east-1",
"requestId": "9e9efa7b-bd51-410a-9387-90dfc8330430",
"operation": "ConverseStream",
"modelId": "us.deepseek.r1-v1:0",
"input": {
"inputContentType": "application/json",
"inputBodyJson": {
"messages": [
{
"role": "user",
"content": [
{
"text": "hello"
}
]
}
],
"system": [
{
"text": "<important_rules>\n You are in chat mode.\n\n If the user asks to make changes to files offer that they can use the Apply Button on the code block, or switch to Agent Mode to make the suggested updates automatically.\n If needed concisely explain to the user they can switch to agent mode using the Mode Selector dropdown and provide no other details.\n\n Always include the language and file name in the info string when you write code blocks.\n If you are editing \"src/main.py\" for example, your code block should start with '```python src/main.py'\n\n When addressing code modification requests, present a concise code snippet that\n emphasizes only the necessary changes and uses abbreviated placeholders for\n unmodified sections. For example:\n\n ```language /path/to/file\n // ... existing code ...\n\n {{ modified code here }}\n\n // ... existing code ...\n\n {{ another modification }}\n\n // ... rest of code ...\n ```\n\n In existing files, you should always restate the function or class that the snippet belongs to:\n\n ```language /path/to/file\n // ... existing code ...\n\n function exampleFunction() {\n // ... existing code ...\n\n {{ modified code here }}\n\n // ... rest of function ...\n }\n\n // ... rest of code ...\n ```\n\n Since users have access to their complete file, they prefer reading only the\n relevant modifications. It's perfectly acceptable to omit unmodified portions\n at the beginning, middle, or end of files using these \"lazy\" comments. Only\n provide the complete file when explicitly requested. Include a concise explanation\n of changes unless the user specifically asks for code only.\n\n</important_rules>\n\n英語で考え、日本語で回答する。\n\nWhen a user asks how a certain part of the code works:\n1. Describe what the code does in isolation.\n2. If the code interacts with other parts of the codebase, describe how the code is imported and used in other parts of the codebase.\n3. When describing each use-case, include the parent function for clarity.\n\nFor unit testing in this project:\n\n1. The project uses Jest as the testing framework\n2. Run tests using `npm test` from within the specific package/module directory\n3. Command structure: `cd [directory] && npm test -- [test file path]`\n4. The test script uses experimental VM modules via NODE_OPTIONS flag\n5. Test files follow the pattern `*.test.ts`\n6. Tests must import Jest with `import { jest } from \"@jest/globals\";`\n7. Run tests from within the specific package directory (e.g., `cd core` for core module tests)\n8. Write tests as top-level `test()` functions - DO NOT use `describe()` blocks\n9. Include the function name being tested in the test description for clarity"
}
],
"inferenceConfig": {
"maxTokens": 4096
},
"additionalModelRequestFields": {}
},
"inputTokenCount": 594,
"cacheReadInputTokenCount": 0,
"cacheWriteInputTokenCount": 0
},
"output": {
"outputContentType": "application/json",
"outputBodyJson": {
"output": {
"message": {
"role": "assistant",
"content": [
{
"reasoningContent": {
"reasoningText": {
"text": "Okay, the user said \"hello\". I need to respond in Japanese. Let me start with a friendly greeting.\n\nThe important rules mention that if the user asks about code changes, I should mention the Apply Button or Agent Mode. But here, it's just a greeting. So no need for that part.\n\nI should keep it simple and welcoming. Maybe ask how I can assist them today. Make sure to use polite Japanese.\n\nAlso, remember the user prefers thinking in English but responses in Japanese. So my response should be in Japanese, natural and conversational.\n\nDouble-check the rules to ensure I'm not missing anything. Since it's a hello, no code involved. Just a standard friendly reply.\n",
"signature": ""
}
}
},
{
"text": "んにちは!どのようなご用件でしょうか?プロジェクトのコードに関する質問や、特定の機能の実装方法、テストの実行方法などについてお手伝いできます。"
}
]
}
},
"stopReason": "end_turn",
"metrics": {
"latencyMs": 2146
},
"usage": {
"inputTokens": 594,
"outputTokens": 185,
"totalTokens": 779
}
},
"outputTokenCount": 185
},
"inferenceRegion": "us-west-2",
"schemaType": "ModelInvocationLog",
"schemaVersion": "1.0"
}
繰り返しますが、ここ数か月はこちらの問題は発生していませんでした。
報告先がわからないので、こちらに投稿させていただきました。
Bedrock チームに届いたらと思います。