RD-Agent icon indicating copy to clipboard operation
RD-Agent copied to clipboard

rdagent fin_quant error

Open qq2100803 opened this issue 6 months ago • 2 comments

🐛 Bug Description

To Reproduce

Steps to reproduce the behavior:

rdagent fin_quant

2025-06-24 18:38:19.651 | INFO | rdagent.oai.backend.litellm:_create_chat_completion_inner_function:169 - Current Cost: $0.0010064400; Accumulated Cost: $0.0095650000; finish_reason='stop' 2025-06-24 18:38:20.656 | WARNING | rdagent.oai.backend.base:_try_create_chat_completion_or_embedding:397 - 1 validation error for dict[str,str] hypothesis Input should be a valid string [type=string_type, input_value=[{'Name': 'Simple Moving ...': ['close', 'volume']}], input_type=list] For further information visit https://errors.pydantic.dev/2.11/v/string_type 2025-06-24 18:38:20.658 | WARNING | rdagent.oai.backend.base:_try_create_chat_completion_or_embedding:398 - Retrying 10th time... Workflow Progress: 25%|███████████████████ | 1/4 [00:00<00:00, 1621.30step/s, loop_index=0, step_index=1, step_name=coding] Traceback (most recent call last): File "/root/miniconda3/envs/rdagent3/bin/rdagent", line 8, in sys.exit(app()) File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/app/cli.py", line 55, in app fire.Fire( File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/fire/core.py", line 135, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/fire/core.py", line 468, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/fire/core.py", line 684, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/app/qlib_rd_loop/quant.py", line 129, in main asyncio.run(quant_loop.run(step_n=step_n, loop_n=loop_n, all_duration=all_duration)) File "/root/miniconda3/envs/rdagent3/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/miniconda3/envs/rdagent3/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/utils/workflow/loop.py", line 327, in run await asyncio.gather( File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/utils/workflow/loop.py", line 276, in kickoff_loop await self._run_step(li) File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/utils/workflow/loop.py", line 219, in _run_step result = func(self.loop_prev_out[li]) File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/app/qlib_rd_loop/quant.py", line 68, in direct_exp_gen hypo = self._propose() File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/components/workflow/rd_loop.py", line 48, in _propose hypothesis = self.hypothesis_gen.gen(self.trace) File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/components/proposal/init.py", line 53, in gen resp = APIBackend().build_messages_and_create_chat_completion( File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/oai/backend/base.py", line 287, in build_messages_and_create_chat_completion resp = self._try_create_chat_completion_or_embedding( # type: ignore[misc] File "/root/miniconda3/envs/rdagent3/lib/python3.10/site-packages/rdagent/oai/backend/base.py", line 400, in _try_create_chat_completion_or_embedding raise RuntimeError(error_message) RuntimeError: Failed to create chat completion after 10 retries.

Expected Behavior

Screenshot

Environment

Note: Users can run rdagent collect_info to get system information and paste it directly here.

  • Name of current operating system:
  • Processor architecture:
  • System, version, and hardware information:
  • Version number of the system:
  • Python version:
  • Container ID:
  • Container Name:
  • Container Status:
  • Image ID used by the container:
  • Image tag used by the container:
  • Container port mapping:
  • Container Label:
  • Startup Commands:
  • RD-Agent version:
  • Package version:

Additional Notes

qq2100803 avatar Jun 24 '25 17:06 qq2100803

This issue is likely due to an unexpected response from the LLM in the earlier stage, such as not answering in the required format, which led to errors in subsequent recognition. The probability of such errors occurring is very low, and you can try running it again. Additionally, you might consider modifying the prompt in the proposal stage to further restrict its format.

TPLin22 avatar Jun 30 '25 06:06 TPLin22

you could also try switching to a different LLM model.

multicollinearity avatar Jul 19 '25 04:07 multicollinearity