Skip to content

Commit 112e091

Browse files
authored
πŸ§‘β€πŸ’» add CD (neo4j#51)
* πŸ§‘β€πŸ’» add CD
1 parent a4a555d commit 112e091

File tree

8 files changed

+76
-73
lines changed

8 files changed

+76
-73
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Release"
2+
3+
permissions:
4+
id-token: write
5+
contents: read
6+
7+
on:
8+
push:
9+
branches:
10+
- "main"
11+
12+
jobs:
13+
build:
14+
permissions:
15+
contents: "read"
16+
id-token: "write"
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- id: "auth"
24+
name: "Authenticate to Google Cloud"
25+
uses: "google-github-actions/auth@v1"
26+
with:
27+
create_credentials_file: true
28+
workload_identity_provider: "projects/861986238120/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions"
29+
service_account: "gha-app-engine-publisher@nallm-experiments.iam.gserviceaccount.com"
30+
- id: "deploy-api"
31+
name: Deploy API to App Engine
32+
uses: "google-github-actions/deploy-appengine@v1"
33+
with:
34+
working_directory: "/home/runner/work/NaLLM/NaLLM/api"
35+
deliverables: api.yaml
36+
- id: "deploy-ui"
37+
name: Deploy UI to App Engine
38+
uses: "google-github-actions/deploy-appengine@v1"
39+
with:
40+
working_directory: "/home/runner/work/NaLLM/NaLLM/ui"
41+
deliverables: app.yaml

api/api.yml renamed to api/api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ runtime: python
22
service: api
33
env: flex
44

5-
entrypoint: cd src && gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app --timeout 60
5+
entrypoint: cd src && gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app --timeout 1000
66

77
runtime_config:
88
operating_system: "ubuntu22"

β€Žapi/src/components/company_report.pyβ€Ž

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ def run(self):
2121
summarize_results = SummarizeCypherResult(
2222
llm=self.llm,
2323
)
24-
24+
print("CompanyReport")
2525
company_data = self.database.query(
2626
"MATCH (n {name:$companyName}) return n.summary, n.isDissolved, n.nbrEmployees, n.name, n.motto, n.isPublic, n.revenue",
2727
{"companyName": self.company},
2828
)
29-
29+
print(company_data)
3030
relation_data = self.database.query(
3131
"MATCH (n {name:$companyName})-[r]->(m) WHERE NOT m:Article OPTIONAL MATCH (m)-[:IN_COUNTRY]->(c:Country) WITH r,m,c return r,m,c",
3232
{"companyName": self.company},
3333
)
34-
34+
print(relation_data)
3535
company_data_output = {
3636
"name": company_data[0]["n.name"],
3737
"motto": company_data[0]["n.motto"],
@@ -41,7 +41,8 @@ def run(self):
4141
"isPublic": company_data[0]["n.isPublic"],
4242
"revenue": company_data[0].get("n.revenue", None),
4343
}
44-
44+
print(company_data_output)
45+
print("all data fetched")
4546
offices = []
4647
suppliers = []
4748
subsidiaries = []
@@ -122,7 +123,7 @@ def run(self):
122123
"Can you summarize the following articles about " + self.company + " ?",
123124
article_data[:HARD_LIMIT_CONTEXT_RECORDS],
124125
)
125-
126+
print("output: " + output)
126127
return {
127128
"company": company_data_output,
128129
"subsidiaries": subsidiaries,

β€Žapi/src/main.pyβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ async def root(payload: ImportPayload):
232232

233233
class companyReportPayload(BaseModel):
234234
company: str
235+
api_key: Optional[str]
235236

236237

237238
# This endpoint is database specific and only works with the Demo database.
@@ -250,7 +251,7 @@ async def companyInformation(payload: companyReportPayload):
250251
model_name="gpt-3.5-turbo-16k-0613",
251252
max_tokens=512,
252253
)
253-
254+
print("Running company report for " + payload.company)
254255
company_report = CompanyReport(neo4j_connection, payload.company, llm)
255256
result = company_report.run()
256257

ui/app.yml renamed to ui/app.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
runtime: nodejs18
1+
runtime: nodejs
22
service: default
3+
env: flex
4+
5+
runtime_config:
6+
operating_system: "ubuntu22"
7+
runtime_version: 18
38

49
env_variables:
510
VITE_UNSTRUCTURED_IMPORT_BACKEND_ENDPOINT: "https://api-dot-nallm-experiments.ew.r.appspot.com"
611
VITE_KG_CHAT_BACKEND_ENDPOINT: "wss://api-dot-nallm-experiments.ew.r.appspot.com/text2text"
712
VITE_HAS_API_KEY_ENDPOINT: "https://api-dot-nallm-experiments.ew.r.appspot.com/hasapikey"
813
VITE_KG_CHAT_SAMPLE_QUESTIONS_ENDPOINT: "https://api-dot-nallm-experiments.ew.r.appspot.com/questionProposalsForCurrentDb"
14+
VITE_REPORT_DATA_ENDPOINT: "https://api-dot-nallm-experiments.ew.r.appspot.com"
915

1016
handlers:
1117
- url: /.*

β€Žui/package-lock.jsonβ€Ž

Lines changed: 15 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žui/src/report-generation/App.tsxβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ function App() {
8787

8888
const changeSelectedCompany = async (company: string) => {
8989
setLoadingCompanyData(true);
90-
const data = await getReportData(company);
90+
const key = apiKey === "" ? undefined : apiKey;
91+
92+
const data = await getReportData(company, key);
9193
setLoadingCompanyData(false);
9294
console.log(data);
9395
if (data) {

β€Žui/src/report-generation/utils/fetch-report.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type JSONResponse = {
88
export const getReportData = async (company: string, apiKey?: string) => {
99
const body = {
1010
company,
11-
apiKey: apiKey ? apiKey : undefined,
11+
api_key: apiKey ? apiKey : undefined,
1212
};
1313

1414
const response = await fetch(

0 commit comments

Comments
Β (0)