-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merge patches from main (#253) * ghcr.io/klimatbyran/garbo:3.1.6 * fix: always return a value * 3.1.7 * ghcr.io/klimatbyran/garbo:3.1.7 * 3.1.8 * ghcr.io/klimatbyran/garbo:3.1.8 --------- Co-authored-by: fluxcdbot <[email protected]> Co-authored-by: Christian Landgren <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix #144 - Update goals prompt and clarify to use climate goals (#254) * Enable stricter TS checks and force workers to always return an explicit result. (#255) * Enable stricter TS checks and force workers to always return an explicit result. For longer-running jobs, this seems to make a difference to mark them as completed. Shorter jobs don't seem to need this, but it doesn't hurt to be explicit. * Consistently parse env vars and crash if something is missing. * Fix type errors for Discord wrapper * Fix type errors in API * Fix some type errors * Ensure scope3 exists before adding categories * Remove old, unused code * Add missing return for precheck job * Remove outdated job searchVectors since this was replaced by nlmParsePDF * Update README to reflect latest updates to Garbo * Show image again * Docs: Describe how to restore local DB backups (#256) * Update local DB name to expected DB name from backups * docs: Describe how to restore local DB backups * Clarify gics extraction to use 8 digits for the subIndustryCode. (#258) Fix #93 * chore: Bump GitHub action versions (#257) * fix: Simplify config and loading of env variables. (#263) Also add missing env var API_BASE_URL * fix: remove unused console.log --------- Co-authored-by: fluxcdbot <[email protected]> Co-authored-by: Christian Landgren <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d14a3db
commit ae2d3ee
Showing
34 changed files
with
216 additions
and
250 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import { z } from 'zod' | ||
|
||
const envSchema = z.object({ | ||
CHROMA_HOST: z.string().default('http://127.0.0.1:8000'), | ||
CHROMA_TOKEN: z.string().optional(), | ||
}) | ||
|
||
const env = envSchema.parse(process.env) | ||
|
||
export default { | ||
path: process.env.CHROMA_HOST || 'http://127.0.0.1:8000', | ||
auth: process.env.CHROMA_TOKEN | ||
path: env.CHROMA_HOST, | ||
auth: env.CHROMA_TOKEN | ||
? { | ||
provider: 'token', | ||
credentials: process.env.CHROMA_TOKEN || '', | ||
credentials: env.CHROMA_TOKEN, | ||
} | ||
: undefined, | ||
} |
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 |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import { z } from 'zod' | ||
|
||
const envSchema = z.object({ | ||
DISCORD_TOKEN: z.string(), | ||
DISCORD_APPLICATION_ID: z.string(), | ||
DISCORD_SERVER_ID: z.string(), | ||
DISCORD_CHANNEL_ID: z.string().default('1201463851447758879'), // defaults to the channel `rapporter-att-granska` on the klimatkollen Discord server | ||
}) | ||
|
||
const env = envSchema.parse(process.env) | ||
|
||
export default { | ||
token: process.env.DISCORD_TOKEN, | ||
clientId: process.env.DISCORD_APPLICATION_ID, | ||
guildId: process.env.DISCORD_SERVER_ID, | ||
worker: process.argv[1].includes('startWorker'), // since the discord is a singleton, we need to know if we are in a worker or not | ||
channelId: process.env.DISCORD_CHANNEL_ID || '1201463851447758879', // set to chanel rapporter-att-granska | ||
token: env.DISCORD_TOKEN, | ||
clientId: env.DISCORD_APPLICATION_ID, | ||
guildId: env.DISCORD_SERVER_ID, | ||
/** | ||
* Since our Discord wrapper is a singleton, we need to know if we are in a worker or not | ||
*/ | ||
worker: process.argv[1].includes('startWorker'), | ||
channelId: env.DISCORD_CHANNEL_ID, | ||
} |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
import { z } from 'zod' | ||
|
||
const envSchema = z.object({ | ||
NLM_INGESTOR_URL: z.string().default('http://0.0.0.0:5001'), | ||
}) | ||
|
||
export const env = envSchema.parse(process.env) | ||
|
||
export default { | ||
url: process.env.NLM_INGESTOR_URL || 'http://localhost:5001', | ||
url: env.NLM_INGESTOR_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
import { z } from 'zod' | ||
|
||
const envSchema = z.object({ | ||
OPENAI_API_KEY: z.string(), | ||
OPENAI_ORG_ID: z.string(), | ||
}) | ||
|
||
const env = envSchema.parse(process.env) | ||
|
||
export default { | ||
openai_api_key: process.env.OPENAI_API_KEY, | ||
openai_organization_id: process.env.OPENAI_ORGANIZATION_ID, | ||
organization: process.env['OPENAI_ORGANIZATION_ID'], | ||
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted | ||
// Used by the `OpenAIEmbeddingFunction` from `chromadb`: | ||
openai_api_key: env.OPENAI_API_KEY, | ||
openai_organization_id: env.OPENAI_ORG_ID, | ||
|
||
// Used by the `openai` Node.js API: | ||
organization: env.OPENAI_ORG_ID, | ||
apiKey: env.OPENAI_API_KEY, | ||
} |
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 |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import { z } from 'zod' | ||
|
||
const envSchema = z.object({ | ||
REDIS_HOST: z.string().default('localhost'), | ||
REDIS_PORT: z.coerce.number().default(6379), | ||
REDIS_PASSWORD: z.string().optional(), | ||
}) | ||
|
||
const env = envSchema.parse(process.env) | ||
|
||
export default { | ||
host: process.env.REDIS_HOST || 'localhost', | ||
port: +process.env.REDIS_PORT || 6379, | ||
password: process.env.REDIS_PASSWORD || undefined, | ||
host: env.REDIS_HOST, | ||
port: env.REDIS_PORT, | ||
password: env.REDIS_PASSWORD, | ||
} |
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
Oops, something went wrong.