mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Added jsonnet for GoogleAIStudio
This commit is contained in:
parent
4ef8332c6f
commit
9d0b79cd82
4 changed files with 124 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
|||
"document-rag": import "components/document-rag.jsonnet",
|
||||
"embeddings-hf": import "components/embeddings-hf.jsonnet",
|
||||
"embeddings-ollama": import "components/embeddings-ollama.jsonnet",
|
||||
"googleaistudio": import "components/googleaistudio.jsonnet",
|
||||
"grafana": import "components/grafana.jsonnet",
|
||||
"graph-rag": import "components/graph-rag.jsonnet",
|
||||
"triple-store-cassandra": import "components/cassandra.jsonnet",
|
||||
|
|
|
|||
90
templates/components/googleaistudio.jsonnet
Normal file
90
templates/components/googleaistudio.jsonnet
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"googleaistudio-key":: "${GOOGLEAISTUDIO_KEY}",
|
||||
"googleaistudio-max-output-tokens":: 4096,
|
||||
"googleaistudio-temperature":: 0.0,
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph)
|
||||
.with_command([
|
||||
"text-completion-googleaistudio",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-k",
|
||||
$["googleaistudio-key"],
|
||||
"-x",
|
||||
std.toString($["googleaistudio-max-output-tokens"]),
|
||||
"-t",
|
||||
std.toString($["googleaistudio-temperature"]),
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph)
|
||||
.with_command([
|
||||
"text-completion-googleaistudio",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-k",
|
||||
$["googleaistudio-key"],
|
||||
"-x",
|
||||
std.toString($["googleaistudio-max-output-tokens"]),
|
||||
"-t",
|
||||
std.toString($["googleaistudio-temperature"]),
|
||||
"-i",
|
||||
"non-persistent://tg/request/text-completion-rag",
|
||||
"-o",
|
||||
"non-persistent://tg/response/text-completion-rag-response",
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ def generate_all(output, version):
|
|||
]:
|
||||
for model in [
|
||||
"azure", "azure-openai", "bedrock", "claude", "cohere",
|
||||
"llamafile", "ollama", "openai", "vertexai"
|
||||
"googleaistudio", "llamafile", "ollama", "openai", "vertexai",
|
||||
]:
|
||||
for graph in [ "cassandra", "neo4j" ]:
|
||||
|
||||
|
|
|
|||
32
templates/patterns/llm-googleaistudio.jsonnet
Normal file
32
templates/patterns/llm-googleaistudio.jsonnet
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
pattern: {
|
||||
name: "googleaistudio",
|
||||
icon: "🤖💬",
|
||||
title: "Add GoogleAIStudio for text completion",
|
||||
description: "This pattern integrates a GoogleAIStudio LLM service for text completion operations. You need a GoogleAISTudio API key to be able to use this service.",
|
||||
requires: ["pulsar", "trustgraph"],
|
||||
features: ["llm"],
|
||||
args: [
|
||||
{
|
||||
name: "googleaistudio-max-output-tokens",
|
||||
label: "Maximum output tokens",
|
||||
type: "integer",
|
||||
description: "Limit on number tokens to generate",
|
||||
default: 4096,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "googleaistudio-temperature",
|
||||
label: "Temperature",
|
||||
type: "slider",
|
||||
description: "Controlling predictability / creativity balance",
|
||||
min: 0,
|
||||
max: 1,
|
||||
step: 0.05,
|
||||
default: 0.5,
|
||||
},
|
||||
],
|
||||
category: [ "llm" ],
|
||||
},
|
||||
module: "components/googleaistudio.jsonnet",
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue