Skip to content

Commit

Permalink
Fixes konveyor#81
Browse files Browse the repository at this point in the history
Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
  • Loading branch information
JonahSussman committed Mar 22, 2024
1 parent 6049eff commit ca386d5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 66 deletions.
61 changes: 0 additions & 61 deletions kai-service/mock-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,66 +276,6 @@ async def main():
{
"violation_name": "jms-to-reactive-quarkus-00010",
"ruleset_name": "kai/quarkus",
"incident_snip": """ 1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
4 * contributors by the @authors tag. See the copyright.txt in the
5 * distribution for a full listing of individual contributors.
6 *
7 * Licensed under the Apache License, Version 2.0 (the \"License\");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an \"AS IS\" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.jboss.as.quickstarts.cmt.mdb;
18
19 import java.util.logging.Logger;
20
21 import javax.ejb.ActivationConfigProperty;
22 import javax.ejb.MessageDriven;
23 import javax.jms.JMSException;
24 import javax.jms.Message;
25 import javax.jms.MessageListener;
26 import javax.jms.TextMessage;
27
28 /**
29 * <p>
30 * A simple Message Driven Bean that asynchronously receives and processes the messages that are sent to the queue.
31 * </p>
32 *
33 * @author Serge Pagop (spagop@redhat.com)
34 *
35 */
36 @MessageDriven(name = \"HelloWorldMDB\", activationConfig = {
37 @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Queue\"),
38 @ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"queue/CMTQueue\"),
39 @ActivationConfigProperty(propertyName = \"acknowledgeMode\", propertyValue = \"Auto-acknowledge\") })
40 public class HelloWorldMDB implements MessageListener {
41
42 private static final Logger logManager = Logger.getLogger(HelloWorldMDB.class.toString());
43
44 /**
45 * @see MessageListener#onMessage(Message)
46 */
47 public void onMessage(Message receivedMessage) {
48 TextMessage textMsg = null;
49 try {
50 if (receivedMessage instanceof TextMessage) {
51 textMsg = (TextMessage) receivedMessage;
52 logManager.info(\"Received Message: \" + textMsg.getText());
53 } else {
54 logManager.warning(\"Message of wrong type: \" + receivedMessage.getClass().getName());
55 }
56 } catch (JMSException ex) {
57 throw new RuntimeException(ex);
58 }
59 }
60 }""",
"incident_variables": {
"file": "file:///tmp/source-code/src/main/java/org/jboss/as/quickstarts/cmt/mdb/HelloWorldMDB.java",
"kind": "Class",
Expand All @@ -349,7 +289,6 @@ async def main():
{
"violation_name": "change_variables",
"ruleset_name": "kai/funny",
"incident_snip": "",
"incident_variables": {
"file": "file:///tmp/source-code/src/main/java/org/jboss/as/quickstarts/cmt/mdb/HelloWorldMDB.java",
"kind": "Class",
Expand Down
2 changes: 1 addition & 1 deletion kai/data/misc/ai-test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from langchain import PromptTemplate
from langchain.callbacks import FileCallbackHandler
from langchain.chains import LLMChain
from langchain.chat_models import ChatOpenAI
from langchain_community.chat_models import ChatOpenAI

template = """
You are an excellent enterprise architect who has an extensive
Expand Down
2 changes: 1 addition & 1 deletion kai/model_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
TextGenerationParameters,
TextGenerationReturnOptions,
)
from langchain_community.chat_models import ChatOpenAI
from langchain_core.messages import BaseMessage, BaseMessageChunk
from langchain_openai import ChatOpenAI

"""
TODO: Add comments. General idea is that we can use dependency injection to
Expand Down
2 changes: 1 addition & 1 deletion kai/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os

from langchain.chains import LLMChain
from langchain.chat_models import ChatOpenAI
from langchain.prompts import PromptTemplate
from langchain_community.chat_models import ChatOpenAI

from .report import Report
from .scm import GitDiff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"import pprint\n",
"\n",
"from langchain import PromptTemplate\n",
"from langchain.chat_models import ChatOpenAI\n",
"from langchain_community.chat_models import ChatOpenAI\n",
"from langchain.chains import LLMChain\n",
"\n",
"pp = pprint.PrettyPrinter(indent=2)\n",
Expand Down Expand Up @@ -262,7 +262,7 @@
"import caikit_tgis_langchain\n",
"import traceback\n",
"\n",
"from langchain_openai import ChatOpenAI\n",
"from langchain_community.chat_models import ChatOpenAI\n",
"from langchain.output_parsers import PydanticOutputParser\n",
"from langchain_core.pydantic_v1 import BaseModel, Field, validator\n",
"from typing import List\n",
Expand Down

0 comments on commit ca386d5

Please sign in to comment.