konveyor / kai

Konveyor AI - static code analysis driven migration to new targets via Generative AI
Apache License 2.0
25 stars 32 forks source link

pydantic_core._pydantic_core.ValidationError: Field required [type=missing, input_value={'violation_name': 'javax... `jakarta.persistence`'}, input_type=dict] #284

Closed jwmatthews closed 2 months ago

jwmatthews commented 3 months ago

I am seeing below when I run from IDE (0.0.2) and using Kai main as of today (August 7 2024).

__()] - Selected model: meta-llama/llama-3-70b-instruct
Config loaded: KaiConfig(log_level='info', file_log_level='debug', log_dir='$pwd/logs', demo_mode=False, trace_enabled=True, incident_store=KaiConfigIncidentStore(solution_detectors=<SolutionDetectorKind.NAIVE: 'naive'>, solution_producers=<SolutionProducerKind.TEXT_ONLY: 'text_only'>, args=KaiConfigIncidentStorePostgreSQLArgs(provider=<KaiConfigIncidentStoreProvider.POSTGRESQL: 'postgresql'>, host='127.0.0.1', database='kai', user='kai', password='dog8code', connection_string=None, solution_detection=<SolutionDetectorKind.NAIVE: 'naive'>)), models=KaiConfigModels(provider='ChatIBMGenAI', args={'model_id': 'meta-llama/llama-3-70b-instruct', 'parameters': {'max_new_tokens': 2048}}, template=None, llama_header=None, llm_retries=5, llm_retry_delay=10.0), solution_consumers=[<SolutionConsumerKind.DIFF_ONLY: 'diff_only'>, <SolutionConsumerKind.LLM_SUMMARY: 'llm_summary'>])
Console logging for 'kai' is set to level 'INFO'
File logging for 'kai' is set to level 'DEBUG' writing to file: '/Users/jmatthews/git/jwmatthews/kai/kai/..//logs/kai_server.log'
INFO - 2024-08-07 16:25:21,573 - kai.service.kai_application.kai_application - [  kai_application.py:54   -             __init__()] - Tracing enabled.
INFO - 2024-08-07 16:25:21,575 - kai.service.kai_application.kai_application - [  kai_application.py:63   -             __init__()] - Selected provider: ChatIBMGenAI
INFO - 2024-08-07 16:25:21,576 - kai.service.kai_application.kai_application - [  kai_application.py:64   -             __init__()] - Selected model: meta-llama/llama-3-70b-instruct
INFO - 2024-08-07 16:25:21,579 - kai.service.kai_application.kai_application - [  kai_application.py:84   -             __init__()] - Selected incident store: postgresql
INFO - 2024-08-07 16:25:21,579 - kai.server - [           server.py:51   -                  app()] - Kai server is ready to receive requests.
INFO - 2024-08-07 16:25:21,590 - kai.service.kai_application.kai_application - [  kai_application.py:84   -             __init__()] - Selected incident store: postgresql
INFO - 2024-08-07 16:25:21,590 - kai.server - [           server.py:51   -                  app()] - Kai server is ready to receive requests.
[2024-08-07 16:25:33 -0400] [84373] [ERROR] Error handling request
Traceback (most recent call last):
  File "/Users/jmatthews/git/jwmatthews/kai/env/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jmatthews/git/jwmatthews/kai/env/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jmatthews/git/jwmatthews/kai/kai/routes/get_incident_solutions_for_file.py", line 36, in post_get_incident_solutions_for_file
    params = PostGetIncidentSolutionsForFileParams.model_validate(await request.json())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jmatthews/git/jwmatthews/kai/env/lib/python3.12/site-packages/pydantic/main.py", line 568, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 6 validation errors for PostGetIncidentSolutionsForFileParams
incidents.0.uri
  Field required [type=missing, input_value={'violation_name': 'javax... `jakarta.persistence`'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/missing
incidents.1.uri
  Field required [type=missing, input_value={'violation_name': 'javax... `jakarta.persistence`'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/missing
incidents.2.uri
  Field required [type=missing, input_value={'violation_name': 'javax... `jakarta.persistence`'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/missing
incidents.3.uri
  Field required [type=missing, input_value={'violation_name': 'javax... `jakarta.persistence`'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/missing
incidents.4.uri
  Field required [type=missing, input_value={'violation_name': 'javax... `jakarta.persistence`'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/missing
incidents.5.uri
  Field required [type=missing, input_value={'violation_name': 'javax...ent with `jakarta.xml`'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/missing
jwmatthews commented 3 months ago

Current belief is that we need to update the IDE code to pass in some missing fields that are now required and validated by backend.