Skip to content
New issue

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

Response validation failed #29

Open
ybdesire opened this issue Jan 2, 2025 · 0 comments
Open

Response validation failed #29

ybdesire opened this issue Jan 2, 2025 · 0 comments

Comments

@ybdesire
Copy link

ybdesire commented Jan 2, 2025

Is there any policy to skip the error?

[-] Response validation failed
Traceback (most recent call last):
  File "/home/aabc/projects/ttst/vulnhuntr/vulnhuntr/LLMs.py", line 45, in _validate_response
    return response_model.model_validate_json(response_text)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aabc/anaconda3/envs/xxtstenv/lib/python3.12/site-packages/pydantic/main.py", line 597, in model_validate_json
    return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for Response
vulnerability_types.2
  Input should be 'LFI', 'RCE', 'SSRF', 'AFO', 'SQLI', 'XSS' or 'IDOR' [type=enum, input_value='DoS', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/enum
Traceback (most recent call last):
  File "/home/aabc/projects/ttst/vulnhuntr/vulnhuntr/LLMs.py", line 45, in _validate_response
    return response_model.model_validate_json(response_text)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aabc/anaconda3/envs/xxtstenv/lib/python3.12/site-packages/pydantic/main.py", line 597, in model_validate_json
    return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for Response
vulnerability_types.2
  Input should be 'LFI', 'RCE', 'SSRF', 'AFO', 'SQLI', 'XSS' or 'IDOR' [type=enum, input_value='DoS', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/enum

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/aabc/projects/ttst/vulnhuntr/vulnhuntr/main.py", line 491, in <module>
    run()
  File "/home/aabc/projects/ttst/vulnhuntr/vulnhuntr/main.py", line 397, in run
    initial_analysis_report: Response = llm.chat(user_prompt, response_model=Response)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aabc/projects/ttst/vulnhuntr/vulnhuntr/LLMs.py", line 75, in chat
    response_text = self._validate_response(response_text, response_model) if response_model else response_text
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aabc/projects/ttst/vulnhuntr/vulnhuntr/LLMs.py", line 48, in _validate_response
    raise LLMError("Validation failed") from e
LLMs.LLMError: Validation failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant