-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into agent-design
- Loading branch information
Showing
42 changed files
with
904 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Sverre Nystad, Magnus Giverin, Maurice Wegerif, Johanne Eide Omland, Artemis Kjøllmoen Aarø, Andreas Lilleby Hjulstad, KartAI | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml | ||
node "Client Device (User's Browser)" as ClientDevice { | ||
[React Application (Web App Frontend)] as ReactApp | ||
} | ||
|
||
node "Server Machine" as ServerMachine { | ||
node "Web Application" <<Docker Container>> as WebAppContainer { | ||
[Next.js Application (Web App Backend)] as NextJSApp | ||
[tRPC Module] as tRPCModule | ||
} | ||
|
||
node "AI Assistant" <<Docker Container>> as AIDockerContainer { | ||
[Python Application (AI Summary Assistant API)] as PythonApp | ||
} | ||
|
||
artifact "Database" <<Docker Volume>> as DockerVolume { | ||
[Database (e.g., PostgreSQL)] as Database | ||
} | ||
|
||
WebAppContainer -[#red,thickness=2]-> DockerVolume : Docker Network Bridge | ||
} | ||
|
||
ClientDevice -[#blue,thickness=2]-> WebAppContainer : HTTP | ||
WebAppContainer -[#green,thickness=2]-> AIDockerContainer : HTTP (REST API) | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@startuml | ||
!define RECTANGLE_BACK_COLOR #EEEEEE | ||
skinparam shadowing false | ||
skinparam rectangle { | ||
BackgroundColor RECTANGLE_BACK_COLOR | ||
BorderColor #333333 | ||
FontStyle bold | ||
FontSize 13 | ||
} | ||
|
||
rectangle "AI Assistant API" { | ||
rectangle "Endpoints" { | ||
[Summarize Endpoint] | ||
[PlanChat Endpoint] | ||
} | ||
|
||
rectangle "Services" { | ||
rectangle "Document Reader" { | ||
[Reader] <|-- [PdfReader] | ||
[Reader] <|-- [XmlReader] | ||
[Reader] <|-- [OCRReader] | ||
|
||
[create_reader] --> [Reader] : "Create Reader Instance <<Factory Pattern>>" | ||
[extract_text] --> [create_reader] : "Read File and Extract Text" | ||
|
||
' Adding a note to Reader | ||
note right of Reader | ||
<<Strategy Pattern>> | ||
Defines the strategy for reading different document types | ||
end note | ||
} | ||
|
||
rectangle "AI Agent Services" { | ||
[invoke_agent] | ||
[invoke_plan_agent] | ||
} | ||
rectangle "External AI Models" { | ||
[query_cad_aid] | ||
[query_arkivgpt] | ||
} | ||
} | ||
} | ||
|
||
[Summarize Endpoint] --> [extract_text] : "Trigger Text Extraction" | ||
[Summarize Endpoint] --> [External AI Models] : "Send Data to External AI Models" | ||
[Summarize Endpoint] --> [invoke_agent] : "Invoke Agent Chain with Extracted Text" | ||
[PlanChat Endpoint] --> [invoke_plan_agent] : "Invoke Plan Agent Chain with User Query" | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@startuml | ||
actor User | ||
|
||
participant "React Application" as ReactApp | ||
participant "tRPC Module" as tRPC | ||
participant "Prisma ORM" as Prisma | ||
participant "MySQL Database" as Database | ||
participant "External AI Model" as AIModel | ||
|
||
User -> ReactApp : Interacts with UI (e.g., Submit Form) | ||
ReactApp -> tRPC : Call tRPC Procedure | ||
tRPC --> AIModel : API Request (HTTP) | ||
AIModel --> tRPC : AI Model Response (HTTP) | ||
tRPC --> Prisma : Save Response (Prisma ORM Create) | ||
Prisma --> Database : SQL Insert Query | ||
Database -> Prisma : Data Confirmation | ||
Prisma -> tRPC : Success Message | ||
tRPC --> ReactApp : Data Response | ||
ReactApp --> User : Display AI Model Results | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
describe("for-soknad-dashbord e2e Tests", () => { | ||
const ROUTES = ["for-soknad/byggeideer/dashbord", "for-soknad/byggeideer/dashbord"] | ||
|
||
ROUTES.forEach((route) => { | ||
describe(`Route: ${route}`, () => { | ||
beforeEach(() => { | ||
// Visit the UserDashboard page before each test | ||
cy.visit(`/${route}`); | ||
cy.clearLocalStorage(); | ||
}); | ||
|
||
it("should render content", () => { | ||
cy.get('[data-cy="title"]').should("be.visible"); | ||
cy.get('[data-cy="pick-address"]').should("be.visible"); | ||
cy.get('[data-cy="todo-list"]').should("be.visible"); | ||
cy.get('[data-cy="planprat"]').should("be.visible"); | ||
cy.get('[data-cy="cadaid-widget"]').should("be.visible"); | ||
cy.get('[data-cy="digital-tiltaksdata-widget"]').should("be.visible"); | ||
cy.get('[data-cy="3d-visning-widget"]').should("be.visible"); | ||
cy.get('[data-cy="document-overview"]').should("be.visible"); | ||
cy.get('[data-cy="arkiv-gpt"]').should("be.visible"); | ||
cy.get('[data-cy="start-application-button"]').should("be.visible"); | ||
}); | ||
|
||
it("should have navigation to correct cadaid page", () => { | ||
cy.get('[data-cy="cadaid-widget"]').click(); | ||
cy.url().should("include", route + "/cadaid"); | ||
}); | ||
|
||
it("should have navigationg to correct arkivGPT page", () => { | ||
cy.get('[data-cy="arkiv-gpt"]').click(); | ||
cy.url().should("include", route + "/arkivgpt"); | ||
}) | ||
|
||
it("should be able to open and close pick address overlay whitout changing anyting", () => { | ||
cy.contains("Ingen addresse valgt").should("be.visible"); | ||
cy.contains("Ingen tomt valgt").should("be.visible"); | ||
cy.contains("Velg adresse og eiendom").click(); | ||
cy.get('[data-cy="overlay-cancel-button"]').click(); | ||
cy.get('[data-cy="pick-address-overlay"]').should("not.exist"); | ||
cy.contains("Ingen addresse valgt").should("be.visible"); | ||
cy.contains("Ingen tomt valgt").should("be.visible"); | ||
}) | ||
|
||
it("should be able to choose adress and property", () => { | ||
cy.contains("Ingen addresse valgt").should("be.visible"); | ||
cy.contains("Ingen tomt valgt").should("be.visible"); | ||
cy.contains("Velg adresse og eiendom").click(); | ||
cy.get('[data-cy="pick-address-overlay"]').should("be.visible") | ||
cy.get('[data-cy="input-address"]').clear().type('TestAdresse'); | ||
cy.get('[data-cy="input-bnr"]').clear().type('TestBnr'); | ||
cy.get('[data-cy="input-gnr"]').clear().type('TestGnr'); | ||
cy.get('[data-cy="overlay-confirm-button"').click(); | ||
cy.contains("TestAdresse").should("be.visible"); | ||
cy.contains("Gnr. TestGnr, Bnr. TestBnr").should("be.visible") | ||
}) | ||
|
||
it("should be able to close popup for analyze build area without any data being saved to local storage", () => { | ||
cy.get('[data-cy="digital-tiltaksdata-widget"]').click(); | ||
cy.get('[data-cy="cancel-3d-widget"]').click(); | ||
cy.window().then((window) => { | ||
const data = window.localStorage.getItem('hasInputDigitalTiltaksdataWidget'); | ||
cy.wrap(data).should('be.null'); | ||
}); | ||
}) | ||
|
||
it("should be able to pick building area and receive feedback", () => { | ||
cy.get('[data-cy="map-feedback"]').should("not.exist"); | ||
cy.get('[data-cy="digital-tiltaksdata-widget"]').click(); | ||
cy.get('[data-cy="mock-map"]').click(); | ||
cy.get('[data-cy="map-feedback"]').should("be.visible"); | ||
}) | ||
|
||
it('"Gjøremål" should change accoring to actions taken by user', () => { | ||
cy.get('[data-cy="address-text"]').should("be.visible"); | ||
cy.get('[data-cy="cadaid-text"]').should("be.visible"); | ||
cy.get('[data-cy="digital-tilraksdata-text"]').should("be.visible"); | ||
cy.get('[data-cy="three-d-visning-text"]').should("be.visible"); | ||
cy.get('[data-cy="planprat-text"]').should("be.visible"); | ||
cy.get('[data-cy="cadaid-widget"]').click(); | ||
cy.visit(`/${route}`); | ||
cy.get('[data-cy="cadaid-text"]').should('not.exist'); | ||
cy.contains("Velg adresse og eiendom").click(); | ||
cy.get('[data-cy="input-address"]').clear().type('TestAdresse'); | ||
cy.get('[data-cy="input-bnr"]').clear().type('TestBnr'); | ||
cy.get('[data-cy="input-gnr"]').clear().type('TestGnr'); | ||
cy.get('[data-cy="overlay-confirm-button"').click(); | ||
cy.get('[data-cy="address-text"]').should("not.exist"); | ||
cy.get('[data-cy="arkivgpt-text"]').should("be.visible"); | ||
cy.get('[data-cy="3d-visning-widget"]').click(); | ||
cy.get('[data-cy="apply-3d-url-button"]').click(); | ||
cy.get('[data-cy="three-d-visning-text"]').should("not.exist"); | ||
cy.get('[data-cy="digital-tiltaksdata-widget"]').click(); | ||
cy.get('[data-cy="mock-map"]').click(); | ||
cy.get('[data-cy="digital-tilraksdata-text"]').should("not.exist"); | ||
}) | ||
|
||
|
||
|
||
}); | ||
}); | ||
}); |
Binary file removed
BIN
-1.06 MB
...able displays data properly -- test landingpage has navigation bar (failed).png
Binary file not shown.
Binary file removed
BIN
-1.1 MB
...on landing page get you to intended target -- test Mottakskontroll (failed).png
Binary file not shown.
Binary file removed
BIN
-1.11 MB
...vbar on landing page get you to intended target -- test før søknad (failed).png
Binary file not shown.
Binary file removed
BIN
-1.1 MB
...ar on landing page get you to intended target -- test under søknad (failed).png
Binary file not shown.
Binary file removed
BIN
-264 KB
...splay No data available when inputting negative or invalid numbers (failed).png
Binary file not shown.
Binary file removed
BIN
-371 KB
...ould open a PDF view when clicking the link element for a response (failed).png
Binary file not shown.
Binary file removed
BIN
-320 KB
...-- should return results when clicking CALL API with valid numbers (failed).png
Binary file not shown.
Binary file removed
BIN
-307 KB
...ute for-soknadcadaid -- should be responsive on mobile devices (failed) (1).png
Binary file not shown.
Binary file removed
BIN
-318 KB
...- Route for-soknadcadaid -- should be responsive on mobile devices (failed).png
Binary file not shown.
Binary file removed
BIN
-300 KB
... -- Route for-soknadcadaid -- should remove a file and its results (failed).png
Binary file not shown.
Binary file removed
BIN
-48.9 KB
...ad-dashbord e2e Tests -- should render content -- before each hook (failed).png
Binary file not shown.
Binary file removed
BIN
-200 KB
...orrectly -- renders the correct number of rows -- before each hook (failed).png
Binary file not shown.
Binary file removed
BIN
-128 KB
...Tests -- should load the iframe without errors -- before each hook (failed).png
Binary file not shown.
Binary file removed
BIN
-251 KB
...s/test_embedded_frame.cy.ts/The page must -- should load the title (failed).png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
webapp/src/app/for-soknad/byggeideer/dashbord/arkivgpt/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import ArkivGPTPage from "~/components/ArkivGPT"; | ||
|
||
export default async function ArkivGPT() { | ||
return ( | ||
<ArkivGPTPage/> | ||
); | ||
} |
9 changes: 9 additions & 0 deletions
9
webapp/src/app/for-soknad/byggeideer/dashbord/cadaid/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import CadaidPage from "~/components/CADAiD"; | ||
|
||
export default async function PlantegningsAnalyse() { | ||
return ( | ||
<CadaidPage/> | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use client"; | ||
import UserDashboard from "~/components/UserDashboard"; | ||
|
||
export default function Dashboard() { | ||
const BASE_URL = "/for-soknad/byggeideer/dashbord"; | ||
return( | ||
<UserDashboard BASE_URL={BASE_URL}/> | ||
); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
webapp/src/app/under-soknad/byggeideer/dashbord/arkivgpt/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import ArkivGPTPage from "~/components/ArkivGPT"; | ||
|
||
export default async function ArkivGPT() { | ||
return ( | ||
<ArkivGPTPage /> | ||
); | ||
} |
7 changes: 7 additions & 0 deletions
7
webapp/src/app/under-soknad/byggeideer/dashbord/cadaid/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import CadaidPage from "~/components/CADAiD"; | ||
|
||
export default async function PlantegningsAnalyse() { | ||
return ( | ||
<CadaidPage /> | ||
); | ||
} |
Oops, something went wrong.