1 line
891 B
JSON
1 line
891 B
JSON
{"repo": "aryang2121/financial-analysis-chatbot", "files": {"chatbot.py": {"a8ae81c3125c8d49b5f7e16c77dfdf2fa9fc87cd": {"t": 1785674424.212428, "n": 654, "h": "4e2bc7b24931c3f9", "c": "import anthropic\n\nclient = anthropic.Anthropic(api_key=\"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\")\n\nprint(\"Claude Chatbot (type 'exit' to quit)\")\nhistory = []\n\nwhile True:\n user_input = input(\"You: \")\n if user_input.lower() == \"exit\":\n break\n\n history.append({\"role\": \"user\", \"content\": user_input})\n\n response = client.messages.create(\n model=\"claude-3-haiku-20240307\",\n max_tokens=500,\n messages=history\n )\n\n reply = response.content[0].text.strip()\n print(\"Claude:\", reply)\n history.append({\"role\": \"assistant\", \"content\": reply})\n"}}}} |