mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-29 10:26:21 +02:00
Fix merge issues with api-key, conflicts with librarian changes (#309)
This commit is contained in:
parent
617eb7efd5
commit
5575e885e5
11 changed files with 8 additions and 23 deletions
|
|
@ -35,6 +35,8 @@ class BaseProcessor:
|
||||||
log_level = params.get("log_level", LogLevel.INFO)
|
log_level = params.get("log_level", LogLevel.INFO)
|
||||||
|
|
||||||
self.pulsar_host = pulsar_host
|
self.pulsar_host = pulsar_host
|
||||||
|
self.pulsar_api_key = pulsar_api_key
|
||||||
|
|
||||||
if pulsar_api_key:
|
if pulsar_api_key:
|
||||||
auth = pulsar.AuthenticationToken(pulsar_api_key)
|
auth = pulsar.AuthenticationToken(pulsar_api_key)
|
||||||
self.client = pulsar.Client(
|
self.client = pulsar.Client(
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ class Processor(ConsumerProducer):
|
||||||
|
|
||||||
print(f"History: {history}", flush=True)
|
print(f"History: {history}", flush=True)
|
||||||
|
|
||||||
def think(x):
|
async def think(x):
|
||||||
|
|
||||||
print(f"Think: {x}", flush=True)
|
print(f"Think: {x}", flush=True)
|
||||||
|
|
||||||
|
|
@ -233,7 +233,7 @@ class Processor(ConsumerProducer):
|
||||||
|
|
||||||
await self.producer.send(r, properties={"id": id})
|
await self.producer.send(r, properties={"id": id})
|
||||||
|
|
||||||
def observe(x):
|
async def observe(x):
|
||||||
|
|
||||||
print(f"Observe: {x}", flush=True)
|
print(f"Observe: {x}", flush=True)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,18 +7,10 @@ from . endpoint import ServiceEndpoint
|
||||||
from . requestor import ServiceRequestor
|
from . requestor import ServiceRequestor
|
||||||
|
|
||||||
class AgentRequestor(ServiceRequestor):
|
class AgentRequestor(ServiceRequestor):
|
||||||
<<<<<<< HEAD
|
|
||||||
def __init__(self, pulsar_client, timeout, auth):
|
def __init__(self, pulsar_client, timeout, auth):
|
||||||
|
|
||||||
super(AgentRequestor, self).__init__(
|
super(AgentRequestor, self).__init__(
|
||||||
pulsar_client=pulsar_client,
|
pulsar_client=pulsar_client,
|
||||||
=======
|
|
||||||
def __init__(self, pulsar_host, timeout, auth, pulsar_api_key=None):
|
|
||||||
|
|
||||||
super(AgentRequestor, self).__init__(
|
|
||||||
pulsar_host=pulsar_host,
|
|
||||||
pulsar_api_key=pulsar_api_key,
|
|
||||||
>>>>>>> a5d5b4c (Add pulsar API token check)
|
|
||||||
request_queue=agent_request_queue,
|
request_queue=agent_request_queue,
|
||||||
response_queue=agent_response_queue,
|
response_queue=agent_response_queue,
|
||||||
request_schema=AgentRequest,
|
request_schema=AgentRequest,
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ class DocumentEmbeddingsStreamEndpoint(SocketEndpoint):
|
||||||
self.pulsar_client, document_embeddings_store_queue,
|
self.pulsar_client, document_embeddings_store_queue,
|
||||||
"api-gateway", "api-gateway",
|
"api-gateway", "api-gateway",
|
||||||
schema=JsonSchema(DocumentEmbeddings),
|
schema=JsonSchema(DocumentEmbeddings),
|
||||||
pulsar_api_key=self.pulsar_api_key
|
|
||||||
)
|
)
|
||||||
|
|
||||||
async def listener(self, ws, running):
|
async def listener(self, ws, running):
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ class GraphEmbeddingsStreamEndpoint(SocketEndpoint):
|
||||||
self.subscriber = Subscriber(
|
self.subscriber = Subscriber(
|
||||||
self.pulsar_client, graph_embeddings_store_queue,
|
self.pulsar_client, graph_embeddings_store_queue,
|
||||||
"api-gateway", "api-gateway",
|
"api-gateway", "api-gateway",
|
||||||
pulsar_api_key=self.pulsar_api_key,
|
|
||||||
schema=JsonSchema(GraphEmbeddings)
|
schema=JsonSchema(GraphEmbeddings)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ class MuxEndpoint(SocketEndpoint):
|
||||||
self, pulsar_client, auth,
|
self, pulsar_client, auth,
|
||||||
services,
|
services,
|
||||||
path="/api/v1/socket",
|
path="/api/v1/socket",
|
||||||
pulsar_api_key=None
|
|
||||||
):
|
):
|
||||||
|
|
||||||
super(MuxEndpoint, self).__init__(
|
super(MuxEndpoint, self).__init__(
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ class ServiceRequestor:
|
||||||
response_queue, response_schema,
|
response_queue, response_schema,
|
||||||
subscription="api-gateway", consumer_name="api-gateway",
|
subscription="api-gateway", consumer_name="api-gateway",
|
||||||
timeout=600,
|
timeout=600,
|
||||||
pulsar_api_key=None,
|
|
||||||
):
|
):
|
||||||
|
|
||||||
self.pub = Publisher(
|
self.pub = Publisher(
|
||||||
|
|
@ -30,7 +29,6 @@ class ServiceRequestor:
|
||||||
self.sub = Subscriber(
|
self.sub = Subscriber(
|
||||||
pulsar_client, response_queue,
|
pulsar_client, response_queue,
|
||||||
subscription, consumer_name,
|
subscription, consumer_name,
|
||||||
pulsar_api_key,
|
|
||||||
JsonSchema(response_schema)
|
JsonSchema(response_schema)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ class ServiceSender:
|
||||||
self,
|
self,
|
||||||
pulsar_client,
|
pulsar_client,
|
||||||
request_queue, request_schema,
|
request_queue, request_schema,
|
||||||
pulsar_api_key=None,
|
|
||||||
):
|
):
|
||||||
|
|
||||||
self.pub = Publisher(
|
self.pub = Publisher(
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,6 @@ class Api:
|
||||||
TriplesLoadEndpoint(
|
TriplesLoadEndpoint(
|
||||||
pulsar_client=self.pulsar_client,
|
pulsar_client=self.pulsar_client,
|
||||||
auth = self.auth,
|
auth = self.auth,
|
||||||
pulsar_api_key=self.pulsar_api_key,
|
|
||||||
),
|
),
|
||||||
GraphEmbeddingsLoadEndpoint(
|
GraphEmbeddingsLoadEndpoint(
|
||||||
pulsar_client=self.pulsar_client,
|
pulsar_client=self.pulsar_client,
|
||||||
|
|
@ -248,7 +247,6 @@ class Api:
|
||||||
pulsar_client=self.pulsar_client,
|
pulsar_client=self.pulsar_client,
|
||||||
auth = self.auth,
|
auth = self.auth,
|
||||||
services = self.services,
|
services = self.services,
|
||||||
pulsar_api_key=self.pulsar_api_key,
|
|
||||||
),
|
),
|
||||||
MetricsEndpoint(
|
MetricsEndpoint(
|
||||||
endpoint_path = "/api/v1/metrics",
|
endpoint_path = "/api/v1/metrics",
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ class TriplesStreamEndpoint(SocketEndpoint):
|
||||||
self.subscriber = Subscriber(
|
self.subscriber = Subscriber(
|
||||||
self.pulsar_client, triples_store_queue,
|
self.pulsar_client, triples_store_queue,
|
||||||
"api-gateway", "api-gateway",
|
"api-gateway", "api-gateway",
|
||||||
pulsar_api_key=self.pulsar_api_key,
|
|
||||||
schema=JsonSchema(Triples)
|
schema=JsonSchema(Triples)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ class GraphRag:
|
||||||
|
|
||||||
self.ge_client = GraphEmbeddingsClient(
|
self.ge_client = GraphEmbeddingsClient(
|
||||||
pulsar_host=pulsar_host,
|
pulsar_host=pulsar_host,
|
||||||
pulsar_api_key=-pulsar_api_key,
|
pulsar_api_key=pulsar_api_key,
|
||||||
subscriber=module + "-ge",
|
subscriber=module + "-ge",
|
||||||
input_queue=ge_request_queue,
|
input_queue=ge_request_queue,
|
||||||
output_queue=ge_response_queue,
|
output_queue=ge_response_queue,
|
||||||
|
|
@ -216,7 +216,7 @@ class GraphRag:
|
||||||
|
|
||||||
self.triples_client = TriplesQueryClient(
|
self.triples_client = TriplesQueryClient(
|
||||||
pulsar_host=pulsar_host,
|
pulsar_host=pulsar_host,
|
||||||
pulsar_api_key=-pulsar_api_key,
|
pulsar_api_key=pulsar_api_key,
|
||||||
subscriber=module + "-tpl",
|
subscriber=module + "-tpl",
|
||||||
input_queue=tpl_request_queue,
|
input_queue=tpl_request_queue,
|
||||||
output_queue=tpl_response_queue
|
output_queue=tpl_response_queue
|
||||||
|
|
@ -224,7 +224,7 @@ class GraphRag:
|
||||||
|
|
||||||
self.embeddings = EmbeddingsClient(
|
self.embeddings = EmbeddingsClient(
|
||||||
pulsar_host=pulsar_host,
|
pulsar_host=pulsar_host,
|
||||||
pulsar_api_key=-pulsar_api_key,
|
pulsar_api_key=pulsar_api_key,
|
||||||
input_queue=emb_request_queue,
|
input_queue=emb_request_queue,
|
||||||
output_queue=emb_response_queue,
|
output_queue=emb_response_queue,
|
||||||
subscriber=module + "-emb",
|
subscriber=module + "-emb",
|
||||||
|
|
@ -238,7 +238,7 @@ class GraphRag:
|
||||||
|
|
||||||
self.prompt = PromptClient(
|
self.prompt = PromptClient(
|
||||||
pulsar_host=pulsar_host,
|
pulsar_host=pulsar_host,
|
||||||
pulsar_api_key=-pulsar_api_key,
|
pulsar_api_key=pulsar_api_key,
|
||||||
input_queue=pr_request_queue,
|
input_queue=pr_request_queue,
|
||||||
output_queue=pr_response_queue,
|
output_queue=pr_response_queue,
|
||||||
subscriber=module + "-prompt",
|
subscriber=module + "-prompt",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue