We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(examples) /ask Select a list of ipynb file paths using the dspy.ReAcT code.
''''' intro_ollama.ipynb:485: "Cell \u001b[0;32mIn[9], line 12\u001b[0m\n\u001b[1;32m 9\u001b[0m generate_answer \u001b[38;5;241m=\u001b[39m dspy\u001b[38;5;241m.\u001b[39mReAct(BasicQA, tools\u001b[38;5;241m=\u001b[39m[dspy\u001b[38;5;241m.\u001b[39mRetrieve(k\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)])\n\u001b[1;32m 11\u001b[0m \u001b[38;5;66;03m# Call the predictor on a particular input.\u001b[39;00m\n\u001b[0;32m---> 12\u001b[0m pred \u001b[38;5;241m=\u001b[39m \u001b[43mgenerate_answer\u001b[49m\u001b[43m(\u001b[49m\u001b[43mquestion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdev_example\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mquestion\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# Print the input and the prediction.\u001b[39;00m\n\u001b[1;32m 15\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m"\u001b[39m\u001b[38;5;124mQuestion: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mdev_example\u001b[38;5;241m.\u001b[39mquestion\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m"\u001b[39m)\n", intro_ollama.ipynb:488: "File \u001b[0;32m/data01/anaconda3/envs/dspy/lib/python3.13/site-packages/dspy/predict/react.py:92\u001b[0m, in \u001b[0;36mReAct.forward\u001b[0;34m(self, input_args)\u001b[0m\n\u001b[1;32m 90\u001b[0m trajectory \u001b[38;5;241m=\u001b[39m {}\n\u001b[1;32m 91\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m idx \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_iters):\n\u001b[0;32m---> 92\u001b[0m pred \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreact\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m\u001b[39;49m\u001b[38;5;241;43m\u001b[39;49m\u001b[43minput_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtrajectory\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mtrajectory\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlast_iteration\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43midx\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m==\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmax_iters\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 94\u001b[0m trajectory[\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m"\u001b[39m\u001b[38;5;124mthought_\u001b[39m\u001b[38;5;132;01m{\u001b[39;00midx\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m"\u001b[39m] \u001b[38;5;241m=\u001b[39m pred\u001b[38;5;241m.\u001b[39mnext_thought\n\u001b[1;32m 95\u001b[0m trajectory[\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m"\u001b[39m\u001b[38;5;124mtool_name_\u001b[39m\u001b[38;5;132;01m{\u001b[39;00midx\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m"\u001b[39m] \u001b[38;5;241m=\u001b[39m pred\u001b[38;5;241m.\u001b[39mnext_tool_name\n", intro_ollama.ipynb:510: "generate_answer = dspy.ReAct(BasicQA, tools=[dspy.Retrieve(k=1)])\n" '''''
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem
Proposed Solution
(examples)
/ask Select a list of ipynb file paths using the dspy.ReAcT code.
'''''
intro_ollama.ipynb:485: "Cell \u001b[0;32mIn[9], line 12\u001b[0m\n\u001b[1;32m 9\u001b[0m generate_answer \u001b[38;5;241m=\u001b[39m dspy\u001b[38;5;241m.\u001b[39mReAct(BasicQA, tools\u001b[38;5;241m=\u001b[39m[dspy\u001b[38;5;241m.\u001b[39mRetrieve(k\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)])\n\u001b[1;32m 11\u001b[0m \u001b[38;5;66;03m# Call the predictor on a particular input.\u001b[39;00m\n\u001b[0;32m---> 12\u001b[0m pred \u001b[38;5;241m=\u001b[39m \u001b[43mgenerate_answer\u001b[49m\u001b[43m(\u001b[49m\u001b[43mquestion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdev_example\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mquestion\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# Print the input and the prediction.\u001b[39;00m\n\u001b[1;32m 15\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m"\u001b[39m\u001b[38;5;124mQuestion: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mdev_example\u001b[38;5;241m.\u001b[39mquestion\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m"\u001b[39m)\n",
intro_ollama.ipynb:488: "File \u001b[0;32m/data01/anaconda3/envs/dspy/lib/python3.13/site-packages/dspy/predict/react.py:92\u001b[0m, in \u001b[0;36mReAct.forward\u001b[0;34m(self, input_args)\u001b[0m\n\u001b[1;32m 90\u001b[0m trajectory \u001b[38;5;241m=\u001b[39m {}\n\u001b[1;32m 91\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m idx \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_iters):\n\u001b[0;32m---> 92\u001b[0m pred \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreact\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m\u001b[39;49m\u001b[38;5;241;43m\u001b[39;49m\u001b[43minput_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtrajectory\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mtrajectory\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlast_iteration\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43midx\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m==\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmax_iters\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 94\u001b[0m trajectory[\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m"\u001b[39m\u001b[38;5;124mthought_\u001b[39m\u001b[38;5;132;01m{\u001b[39;00midx\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m"\u001b[39m] \u001b[38;5;241m=\u001b[39m pred\u001b[38;5;241m.\u001b[39mnext_thought\n\u001b[1;32m 95\u001b[0m trajectory[\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m"\u001b[39m\u001b[38;5;124mtool_name_\u001b[39m\u001b[38;5;132;01m{\u001b[39;00midx\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m"\u001b[39m] \u001b[38;5;241m=\u001b[39m pred\u001b[38;5;241m.\u001b[39mnext_tool_name\n",
intro_ollama.ipynb:510: "generate_answer = dspy.ReAct(BasicQA, tools=[dspy.Retrieve(k=1)])\n"
'''''
Additional context
The text was updated successfully, but these errors were encountered: