mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-27 09:26:22 +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
|
|
@ -6,6 +6,7 @@ Input is prompt, output is response.
|
|||
|
||||
import anthropic
|
||||
from prometheus_client import Histogram
|
||||
import os
|
||||
|
||||
from .... schema import TextCompletionRequest, TextCompletionResponse, Error
|
||||
from .... schema import text_completion_request_queue
|
||||
|
|
@ -22,6 +23,7 @@ default_subscriber = module
|
|||
default_model = 'claude-3-5-sonnet-20240620'
|
||||
default_temperature = 0.0
|
||||
default_max_output = 8192
|
||||
default_api_key = os.getenv("CLAUDE_KEY")
|
||||
|
||||
class Processor(ConsumerProducer):
|
||||
|
||||
|
|
@ -31,10 +33,13 @@ class Processor(ConsumerProducer):
|
|||
output_queue = params.get("output_queue", default_output_queue)
|
||||
subscriber = params.get("subscriber", default_subscriber)
|
||||
model = params.get("model", default_model)
|
||||
api_key = params.get("api_key")
|
||||
api_key = params.get("api_key", default_api_key)
|
||||
temperature = params.get("temperature", default_temperature)
|
||||
max_output = params.get("max_output", default_max_output)
|
||||
|
||||
if api_key is None:
|
||||
raise RuntimeError("Claude API key not specified")
|
||||
|
||||
super(Processor, self).__init__(
|
||||
**params | {
|
||||
"input_queue": input_queue,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue