konveyor-ecosystem / kai

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

DEMO_MODE - Request to model failed ... #147

Closed jwmatthews closed 2 months ago

jwmatthews commented 2 months ago

I have been able to trip things up so data appears to be corrupted and it can't return a response with #144

Unsure if this is from using gpt-3.5-turbo, or something else.

kai/config.toml

provider = "OpenAI"
args = { model_id = "gpt-3.5-turbo" }

I see the below in server console output

Connection error.
WARNING - 2024-04-04 16:31:14,164 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.
WARNING - 2024-04-04 16:31:26,631 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.
WARNING - 2024-04-04 16:31:39,318 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.

Looking on disk:

$ less "-Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml" 
Invalid line number
No tags file

Tree view:

 $ tree .
.
├── gpt-3.5-turbo
│   ├── -Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml
│   ├── -Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-Order.java.yaml
│   ├── -Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-OrderItem.java.yaml
│   └── -Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-ShoppingCart.java.yaml
├── ibm
│   └── granite-13b-chat-v2
│       └── -Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml
└── ibm-mistralai
    └── mixtral-8x7b-instruct-v01-q
        ├── pom.xml.yaml
        ├── src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml
        ├── src-main-java-com-redhat-coolstore-model-Order.java.yaml
        ├── src-main-java-com-redhat-coolstore-model-OrderItem.java.yaml
        ├── src-main-java-com-redhat-coolstore-model-ShoppingCart.java.yaml
        ├── src-main-java-com-redhat-coolstore-persistence-Resources.java.yaml
        ├── src-main-java-com-redhat-coolstore-rest-CartEndpoint.java.yaml
        ├── src-main-java-com-redhat-coolstore-rest-OrderEndpoint.java.yaml
        ├── src-main-java-com-redhat-coolstore-rest-ProductEndpoint.java.yaml
        ├── src-main-java-com-redhat-coolstore-rest-RestApplication.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-CatalogService.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-InventoryNotificationMDB.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-OrderService.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-OrderServiceMDB.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-ProductService.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-PromoService.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-ShippingService.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-ShoppingCartOrderProcessor.java.yaml
        ├── src-main-java-com-redhat-coolstore-service-ShoppingCartService.java.yaml
        ├── src-main-java-com-redhat-coolstore-utils-DataBaseMigrationStartup.java.yaml
        ├── src-main-java-com-redhat-coolstore-utils-Producers.java.yaml
        ├── src-main-java-com-redhat-coolstore-utils-StartupListener.java.yaml
        ├── src-main-java-com-redhat-coolstore-utils-Transformers.java.yaml
        ├── src-main-resources-META-INF-persistence.xml.yaml
        ├── src-main-webapp-WEB-INF-beans.xml.yaml
        └── src-main-webapp-WEB-INF-web.xml.yaml

I deleted the gpt-3.5-turbo cached directory

Re-ran and saw success with the uncached request. It cached the request and it looks like it has more data that the prior version, ~100kb file

$ ls -lart -- "-Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml"

-rw-r--r--  1 jmatthews  staff   109K Apr  4 16:40 -Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml

$ gist -- "-Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml" 
https://gist.github.com/jwmatthews/ce5a82224e598422dbf1b6ab7e091320

Reattempt the request from IDE, I see the below in server console

INFO - 2024-04-04 17:04:04,325 - [server.py:469 - get_incident_solutions_for_file() ] - START - App: 'coolstore', File: '/Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java' with 6 incidents'
INFO - 2024-04-04 17:04:04,390 - [server.py:547 - get_incident_solutions_for_file() ] - Processing incident batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java
WARNING - 2024-04-04 17:04:06,979 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.
WARNING - 2024-04-04 17:04:19,686 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.
WARNING - 2024-04-04 17:04:32,337 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.
WARNING - 2024-04-04 17:04:44,800 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.
WARNING - 2024-04-04 17:04:57,288 - [server.py:575 - get_incident_solutions_for_file() ] - Request to model failed for batch 1/1 for /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java with exception, retrying in 10s
Connection error.
ERROR - 2024-04-04 17:05:07,291 - [server.py:581 - get_incident_solutions_for_file() ] - /Users/jmatthews/git/jwmatthews/kai/example/coolstore/src/main/java/com/redhat/coolstore/model/InventoryEntity.java failed to migrate

Looking at what is cached:

$ ls -lart -- "-Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml" 

-rw-r--r--  1 jmatthews  staff   109K Apr  4 16:40 -Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml

$ gist -- "-Users-jmatthews-git-jwmatthews-kai-example-coolstore-src-main-java-com-redhat-coolstore-model-InventoryEntity.java.yaml"    
https://gist.github.com/jwmatthews/a60ff5045df22b6934abdb5d7694d050
fabianvf commented 2 months ago

Hmm, I didn't do much testing with openai. Could be using a different library under the hood