mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-19 18:21:03 +02:00
Remove cruft
This commit is contained in:
parent
b110af41fb
commit
24d05cbcdf
2 changed files with 9 additions and 12 deletions
|
|
@ -3,7 +3,12 @@
|
||||||
import json
|
import json
|
||||||
from trustgraph.clients.prompt_client import PromptClient
|
from trustgraph.clients.prompt_client import PromptClient
|
||||||
|
|
||||||
p = PromptClient(pulsar_host="pulsar://localhost:6650")
|
p = PromptClient(
|
||||||
|
pulsar_host="pulsar://localhost:6650",
|
||||||
|
input_queue="non-persistent://tg/request/prompt:default",
|
||||||
|
output_queue="non-persistent://tg/response/prompt:default",
|
||||||
|
subscriber="test1",
|
||||||
|
)
|
||||||
|
|
||||||
chunk="""
|
chunk="""
|
||||||
The Space Shuttle was a reusable spacecraft that transported astronauts and cargo to and from Earth's orbit. It was designed to launch like a rocket, maneuver in orbit like a spacecraft, and land like an airplane. The Space Shuttle was NASA's space transportation system and was used for many purposes, including:
|
The Space Shuttle was a reusable spacecraft that transported astronauts and cargo to and from Earth's orbit. It was designed to launch like a rocket, maneuver in orbit like a spacecraft, and land like an airplane. The Space Shuttle was NASA's space transportation system and was used for many purposes, including:
|
||||||
|
|
@ -31,8 +36,8 @@ The Space Shuttle's last mission was in 2011.
|
||||||
q = "Tell me some facts in the knowledge graph"
|
q = "Tell me some facts in the knowledge graph"
|
||||||
|
|
||||||
resp = p.request(
|
resp = p.request(
|
||||||
id="extract-definition",
|
id="extract-definitions",
|
||||||
terms = {
|
variables = {
|
||||||
"text": chunk,
|
"text": chunk,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -40,7 +45,7 @@ resp = p.request(
|
||||||
print(resp)
|
print(resp)
|
||||||
|
|
||||||
for fact in resp:
|
for fact in resp:
|
||||||
print(fact["term"], "::")
|
print(fact["entity"], "::")
|
||||||
print(fact["definition"])
|
print(fact["definition"])
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,14 +33,6 @@ class Processor(FlowProcessor):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
# self.llm = LlmClient(
|
|
||||||
# subscriber=subscriber,
|
|
||||||
# input_queue=tc_request_queue,
|
|
||||||
# output_queue=tc_response_queue,
|
|
||||||
# pulsar_host = self.pulsar_host,
|
|
||||||
# pulsar_api_key=self.pulsar_api_key,
|
|
||||||
# )
|
|
||||||
|
|
||||||
self.register_specification(
|
self.register_specification(
|
||||||
ConsumerSpec(
|
ConsumerSpec(
|
||||||
name = "request",
|
name = "request",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue