{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": ".\/venv\/bin\/python -c \"\nimport requests\nfrom config import OLLAMA_HOST, EMBEDDING_MODEL\nfrom db import db\n\ndb.connect()\n\n# Get chunk content\ncursor = db.execute('SELECT content FROM chunks WHERE id = 8')\nchunk = cursor.fetchone()\ncursor.close()\ncontent = chunk['content']\n\nprint(f'Testing embedding for chunk with {len(content)} chars...')\n\n# Test with num_ctx\nresponse = requests.post(\n f'{OLLAMA_HOST}\/api\/embeddings',\n json={\n 'model': EMBEDDING_MODEL,\n 'prompt': content,\n 'options': {'num_ctx': 8192}\n },\n timeout=60\n)\n\nprint(f'Status: {response.status_code}')\nif response.status_code == 200:\n data = response.json()\n if 'embedding' in data:\n print(f'SUCCESS: {len(data[\\\"embedding\\\"])} dimensions')\nelse:\n print(f'Error: {response.text}')\n\ndb.disconnect()\n\"",
"description": "Test embedding with extended context directly"
}
}
{
"tool_response": {
"stdout": "Testing embedding for chunk with 1787 chars...\nStatus: 500\nError: {\"error\":\"the input length exceeds the context length\"}",
"stderr": "",
"interrupted": false,
"isImage": false
}
}