mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Feature/environment var creds (#116)
- Change templates to interpolate environment variables in docker compose - Change templates to invoke secrets for environment variable credentials in K8s configuration - Update LLMs to pull in credentials from environment variables if not specified
This commit is contained in:
parent
43756d872b
commit
86288339cf
20 changed files with 327 additions and 271 deletions
|
|
@ -7,6 +7,7 @@ Google Cloud. Input is prompt, output is response.
|
|||
import vertexai
|
||||
import time
|
||||
from prometheus_client import Histogram
|
||||
import os
|
||||
|
||||
from google.oauth2 import service_account
|
||||
import google
|
||||
|
|
@ -38,6 +39,7 @@ default_model = 'gemini-1.0-pro-001'
|
|||
default_region = 'us-central1'
|
||||
default_temperature = 0.0
|
||||
default_max_output = 8192
|
||||
default_private_key = os.getenv("VERTEXAI_KEY")
|
||||
|
||||
class Processor(ConsumerProducer):
|
||||
|
||||
|
|
@ -48,10 +50,13 @@ class Processor(ConsumerProducer):
|
|||
subscriber = params.get("subscriber", default_subscriber)
|
||||
region = params.get("region", default_region)
|
||||
model = params.get("model", default_model)
|
||||
private_key = params.get("private_key")
|
||||
private_key = params.get("private_key", default_private_key)
|
||||
temperature = params.get("temperature", default_temperature)
|
||||
max_output = params.get("max_output", default_max_output)
|
||||
|
||||
if private_key is None:
|
||||
raise RuntimeError("Private key file not specified")
|
||||
|
||||
super(Processor, self).__init__(
|
||||
**params | {
|
||||
"input_queue": input_queue,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue