Added agent support to templates (#150)

This commit is contained in:
cybermaggedon 2024-11-12 00:22:18 +00:00 committed by GitHub
parent f654d72515
commit efd13ae5f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 158 additions and 0 deletions

7
docs/README.agent-demo Normal file
View file

@ -0,0 +1,7 @@
tg-processor-state
tg-load-text --keyword cats animals home-life --name "Mark's cats" --description "This document describes Mark's cats" --copyright-notice 'Public domain' --publication-organization 'trustgraph.ai' --publication-date 2024-10-23 --copyright-holder 'trustgraph.ai' --copyright-year 2024 --publication-description 'Uploading to Github' --url https://example.com --id TG-000001 ../trustgraph/README.cats
tg-load-text --keyword nasa challenger space-shuttle shuttle orbiter --name 'Challenger Report Volume 1' --description 'The findings of the Presidential Commission regarding the circumstances surrounding the Challenger accident are reported and recommendations for corrective action are outlined' --copyright-notice 'Work of the US Gov. Public Use Permitted' --publication-organization 'NASA' --publication-date 1986-06-06 --copyright-holder 'US Government' --copyright-year 1986 --publication-description 'The findings of the Commission regarding the circumstances surrounding the Challenger accident are reported' --url https://ntrs.nasa.gov/citations/19860015255 --id AD-A171402 ../trustgraph/README.challenger

35
docs/README.cats Normal file
View file

@ -0,0 +1,35 @@
My name is Mark.
I have 2 cats:
- Fred is a big, fat, orange, stripy cat. He is 12 years old and has 4 legs.
- Hope is a small, black cat. She is 7 years old and also has 4 legs.
Fred has 4 legs.
Hope has 4 legs.
Fred and Hope are nice animals, but occasionally they fight.
Fred is lazy and sleeps a lot. Hope is energetic, runs around a lot and
climbs trees.
Both cats have tails and whiskers like all cats do.
Cats have the species name Felis catus.
The cat (Felis catus), also referred to as domestic cat or house cat, is a
small domesticated carnivorous mammal. It is the only domesticated species of
the family Felidae. Advances in archaeology and genetics have shown that the
domestication of the cat occurred in the Near East around 7500 BC. It is
commonly kept as a pet and farm cat, but also ranges freely as a feral cat
avoiding human contact. Valued by humans for companionship and its ability to
kill vermin, the cat's retractable claws are adapted to killing small prey
like mice and rats. It has a strong, flexible body, quick reflexes, and sharp
teeth, and its night vision and sense of smell are well developed. It is a
social species, but a solitary hunter and a crepuscular predator. Cat
communication includes vocalizations—including meowing, purring, trilling,
hissing, growling, and gruntingas well as body language. It can hear sounds
too faint or too high in frequency for human ears, such as those made by small
mammals. It secretes and perceives pheromones.

54
docs/README.challenger Normal file
View file

@ -0,0 +1,54 @@
On January 28, 1986, the Space Shuttle Challenger broke apart 73 seconds into
its flight, killing all seven crew members aboard. The spacecraft
disintegrated 46,000 feet (14 km) above the Atlantic Ocean, off the coast of
Cape Canaveral, Florida, at 11:39 a.m. EST (16:39 UTC). It was the first fatal
accident involving an American spacecraft while in flight.
The mission, designated STS-51-L, was the 10th flight for the orbiter and the
25th flight of the Space Shuttle fleet. The crew was scheduled to deploy a
communications satellite and study Halley's Comet while they were in orbit, in
addition to taking schoolteacher Christa McAuliffe into space under the
Teacher In Space program. The latter task resulted in a higher-than-usual
media interest in and coverage of the mission; the launch and subsequent
disaster were seen live in many schools across the United States.
The cause of the disaster was the failure of the primary and secondary O-ring
seals in a joint in the shuttle's right solid rocket booster (SRB). The
record-low temperatures on the morning of the launch had stiffened the rubber
O-rings, reducing their ability to seal the joints. Shortly after liftoff, the
seals were breached, and hot pressurized gas from within the SRB leaked
through the joint and burned through the aft attachment strut connecting it to
the external propellant tank (ET), then into the tank itself. The collapse of
the ET's internal structures and the rotation of the SRB that followed threw
the shuttle stack, traveling at a speed of Mach 1.92, into a direction that
allowed aerodynamic forces to tear the orbiter apart. Both SRBs detached from
the now-destroyed ET and continued to fly uncontrollably until the range
safety officer destroyed them.
The crew compartment, human remains, and many other fragments from the shuttle
were recovered from the ocean floor after a three-month search-and-recovery
operation. The exact timing of the deaths of the crew is unknown, but several
crew members are thought to have survived the initial breakup of the
spacecraft. The orbiter had no escape system, and the impact of the crew
compartment at terminal velocity with the ocean surface was too violent to be
survivable.
The disaster resulted in a 32-month hiatus in the Space Shuttle
program. President Ronald Reagan created the Rogers Commission to investigate
the accident. The commission criticized NASA's organizational culture and
decision-making processes that had contributed to the accident. Test data
since 1977 demonstrated a potentially catastrophic flaw in the SRBs' O-rings,
but neither NASA nor SRB manufacturer Morton Thiokol had addressed this known
defect. NASA managers also disregarded engineers' warnings about the dangers
of launching in cold temperatures and did not report these technical concerns
to their superiors.
As a result of this disaster, NASA established the Office of Safety,
Reliability, and Quality Assurance, and arranged for deployment of commercial
satellites from expendable launch vehicles rather than from a crewed
orbiter. To replace Challenger, the construction of a new Space Shuttle
orbiter, Endeavour, was approved in 1987, and the new orbiter first flew in
1992. Subsequent missions were launched with redesigned SRBs and their crews
wore pressurized suits during ascent and reentry.

View file

@ -28,6 +28,8 @@
"vertexai": import "components/vertexai.jsonnet",
"null": {},
"agent-manager-react": import "components/agent-manager-react.jsonnet",
// FIXME: Dupes
"cassandra": import "components/cassandra.jsonnet",
"neo4j": import "components/neo4j.jsonnet",

View file

@ -0,0 +1,60 @@
local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompts/mixtral.jsonnet";
local default_prompts = import "prompts/default-prompts.jsonnet";
{
tools:: [],
"agent-manager" +: {
create:: function(engine)
local container =
engine.container("agent-manager")
.with_image(images.trustgraph)
.with_command([
"agent-manager-react",
"-p",
url.pulsar,
"--tool-type",
] + [
tool.id + "=" + tool.type
for tool in $.tools
] + [
"--tool-description"
] + [
tool.id + "=" + tool.description
for tool in $.tools
] + [
"--tool-argument"
] + [
"%s=%s:%s:%s" % [
tool.id, arg.name, arg.type, arg.description
]
for tool in $.tools
for arg in tool.arguments
]
)
.with_limits("0.5", "128M")
.with_reservations("0.1", "128M");
local containerSet = engine.containers(
"agent-manager", [ container ]
);
local service =
engine.internalService(containerSet)
.with_port(8000, 8000, "metrics");
engine.resources([
containerSet,
service,
])
},
} + default_prompts