Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions neuro_san/api/grpc/agent_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@
# END COPYRIGHT
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: neuro_san/api/grpc/agent.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 6.31.1
Copy link
Collaborator

@d1donlydfink d1donlydfink Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redid ./neuro_san/api/scripts/do_generate.sh on Python 3.12 with protobuf==6.31.1.
Here are some testing results:

  • agent_service.json is generated exactly the same way by the golang tools, as far as I can tell.
  • new protobuf 6 server with new protobuf 6 client is fine
  • new protobuf 6 server with old protobuf 4 client is fine
  • old protobuf 4 server with new protobuf 6 client is fine

What will happen is a ImportError will trip if you have an older protobuf 4 venv and you try to run against these newly generated grpc files...

  File "/home//sandbox1/esp/gitrepos/neuro-san/neuro_san/service/main_loop/server_main_loop.py", line 32, in <module>
    from neuro_san.service.grpc.grpc_agent_server import DEFAULT_SERVER_NAME
  File "/home/d/sandbox1/esp/gitrepos/neuro-san/neuro_san/service/grpc/grpc_agent_server.py", line 21, in <module>
    from neuro_san.api.grpc import agent_pb2
  File "/home//sandbox1/esp/gitrepos/neuro-san/neuro_san/api/grpc/agent_pb2.py", line 20, in <module>
    from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (/home/venv/ns/lib/python3.12/site-packages/google/protobuf/__init__.py)

"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
6,
31,
1,
'',
'neuro_san/api/grpc/agent.proto'
)
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()
Expand All @@ -33,14 +43,14 @@
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'neuro_san.api.grpc.agent_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'Zegithub.com/cognizant-ai-lab/neuro_san/internal/gen/dev.cognizant_ai/neuro_san/api/grpc/agent/v1;agent'
_globals['_AGENTSERVICE'].methods_by_name['Function']._options = None
_globals['_AGENTSERVICE'].methods_by_name['Function']._loaded_options = None
_globals['_AGENTSERVICE'].methods_by_name['Function']._serialized_options = b'\202\323\344\223\002\037\022\035/api/v1/{agent_name}/function'
_globals['_AGENTSERVICE'].methods_by_name['StreamingChat']._options = None
_globals['_AGENTSERVICE'].methods_by_name['StreamingChat']._loaded_options = None
_globals['_AGENTSERVICE'].methods_by_name['StreamingChat']._serialized_options = b'\202\323\344\223\002(\"#/api/v1/{agent_name}/streaming_chat:\001*'
_globals['_AGENTSERVICE'].methods_by_name['Connectivity']._options = None
_globals['_AGENTSERVICE'].methods_by_name['Connectivity']._loaded_options = None
_globals['_AGENTSERVICE'].methods_by_name['Connectivity']._serialized_options = b'\202\323\344\223\002#\022!/api/v1/{agent_name}/connectivity'
_globals['_CHATFILTERTYPE']._serialized_start=1342
_globals['_CHATFILTERTYPE']._serialized_end=1397
Expand Down
75 changes: 63 additions & 12 deletions neuro_san/api/grpc/agent_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,29 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from neuro_san.api.grpc import agent_pb2 as neuro__san_dot_api_dot_grpc_dot_agent__pb2

GRPC_GENERATED_VERSION = '1.74.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in neuro_san/api/grpc/agent_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)


class AgentServiceStub(object):
"""The service comprises all the exchanges to the backend in support of a single agent's
Expand All @@ -33,17 +53,17 @@ def __init__(self, channel):
'/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/Function',
request_serializer=neuro__san_dot_api_dot_grpc_dot_agent__pb2.FunctionRequest.SerializeToString,
response_deserializer=neuro__san_dot_api_dot_grpc_dot_agent__pb2.FunctionResponse.FromString,
)
_registered_method=True)
self.StreamingChat = channel.unary_stream(
'/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/StreamingChat',
request_serializer=neuro__san_dot_api_dot_grpc_dot_agent__pb2.ChatRequest.SerializeToString,
response_deserializer=neuro__san_dot_api_dot_grpc_dot_agent__pb2.ChatResponse.FromString,
)
_registered_method=True)
self.Connectivity = channel.unary_unary(
'/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/Connectivity',
request_serializer=neuro__san_dot_api_dot_grpc_dot_agent__pb2.ConnectivityRequest.SerializeToString,
response_deserializer=neuro__san_dot_api_dot_grpc_dot_agent__pb2.ConnectivityResponse.FromString,
)
_registered_method=True)


class AgentServiceServicer(object):
Expand Down Expand Up @@ -111,6 +131,7 @@ def add_AgentServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand All @@ -132,11 +153,21 @@ def Function(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/Function',
return grpc.experimental.unary_unary(
request,
target,
'/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/Function',
neuro__san_dot_api_dot_grpc_dot_agent__pb2.FunctionRequest.SerializeToString,
neuro__san_dot_api_dot_grpc_dot_agent__pb2.FunctionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def StreamingChat(request,
Expand All @@ -149,11 +180,21 @@ def StreamingChat(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/StreamingChat',
return grpc.experimental.unary_stream(
request,
target,
'/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/StreamingChat',
neuro__san_dot_api_dot_grpc_dot_agent__pb2.ChatRequest.SerializeToString,
neuro__san_dot_api_dot_grpc_dot_agent__pb2.ChatResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def Connectivity(request,
Expand All @@ -166,8 +207,18 @@ def Connectivity(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/Connectivity',
return grpc.experimental.unary_unary(
request,
target,
'/dev.cognizant_ai.neuro_san.api.grpc.agent.AgentService/Connectivity',
neuro__san_dot_api_dot_grpc_dot_agent__pb2.ConnectivityRequest.SerializeToString,
neuro__san_dot_api_dot_grpc_dot_agent__pb2.ConnectivityResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
16 changes: 13 additions & 3 deletions neuro_san/api/grpc/chat_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@
# END COPYRIGHT
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: neuro_san/api/grpc/chat.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 6.31.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
6,
31,
1,
'',
'neuro_san/api/grpc/chat.proto'
)
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()
Expand All @@ -32,8 +42,8 @@
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'neuro_san.api.grpc.chat_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'Zcgithub.com/cognizant-ai-lab/neuro_san/internal/gen/dev.cognizant_ai/neuro_san/api/grpc/chat/v1;chat'
_globals['_ORIGIN']._serialized_start=141
_globals['_ORIGIN']._serialized_end=219
Expand Down
20 changes: 20 additions & 0 deletions neuro_san/api/grpc/chat_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,24 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings


GRPC_GENERATED_VERSION = '1.74.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in neuro_san/api/grpc/chat_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)
18 changes: 14 additions & 4 deletions neuro_san/api/grpc/concierge_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@
# END COPYRIGHT
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: neuro_san/api/grpc/concierge.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 6.31.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
6,
31,
1,
'',
'neuro_san/api/grpc/concierge.proto'
)
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()
Expand All @@ -31,10 +41,10 @@
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'neuro_san.api.grpc.concierge_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'Zmgithub.com/cognizant-ai-lab/neuro_san/internal/gen/dev.cognizant_ai/neuro_san/api/grpc/concierge/v1;concierge'
_globals['_CONCIERGESERVICE'].methods_by_name['List']._options = None
_globals['_CONCIERGESERVICE'].methods_by_name['List']._loaded_options = None
_globals['_CONCIERGESERVICE'].methods_by_name['List']._serialized_options = b'\202\323\344\223\002\016\022\014/api/v1/list'
_globals['_CONCIERGEREQUEST']._serialized_start=115
_globals['_CONCIERGEREQUEST']._serialized_end=133
Expand Down
39 changes: 35 additions & 4 deletions neuro_san/api/grpc/concierge_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,29 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from neuro_san.api.grpc import concierge_pb2 as neuro__san_dot_api_dot_grpc_dot_concierge__pb2

GRPC_GENERATED_VERSION = '1.74.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in neuro_san/api/grpc/concierge_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)


class ConciergeServiceStub(object):
"""The service provides system-wide information about resources available
Expand All @@ -31,7 +51,7 @@ def __init__(self, channel):
'/dev.cognizant_ai.neuro_san.api.grpc.concierge.ConciergeService/List',
request_serializer=neuro__san_dot_api_dot_grpc_dot_concierge__pb2.ConciergeRequest.SerializeToString,
response_deserializer=neuro__san_dot_api_dot_grpc_dot_concierge__pb2.ConciergeResponse.FromString,
)
_registered_method=True)


class ConciergeServiceServicer(object):
Expand All @@ -58,6 +78,7 @@ def add_ConciergeServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'dev.cognizant_ai.neuro_san.api.grpc.concierge.ConciergeService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('dev.cognizant_ai.neuro_san.api.grpc.concierge.ConciergeService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
Expand All @@ -77,8 +98,18 @@ def List(request,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/dev.cognizant_ai.neuro_san.api.grpc.concierge.ConciergeService/List',
return grpc.experimental.unary_unary(
request,
target,
'/dev.cognizant_ai.neuro_san.api.grpc.concierge.ConciergeService/List',
neuro__san_dot_api_dot_grpc_dot_concierge__pb2.ConciergeRequest.SerializeToString,
neuro__san_dot_api_dot_grpc_dot_concierge__pb2.ConciergeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
16 changes: 13 additions & 3 deletions neuro_san/api/grpc/mime_data_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@
# END COPYRIGHT
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: neuro_san/api/grpc/mime_data.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 6.31.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
6,
31,
1,
'',
'neuro_san/api/grpc/mime_data.proto'
)
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()
Expand All @@ -30,8 +40,8 @@
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'neuro_san.api.grpc.mime_data_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'Zmgithub.com/cognizant-ai-lab/neuro_san/internal/gen/dev.cognizant_ai/neuro_san/api/grpc/mime_data/v1;mime_data'
_globals['_MIMEDATA']._serialized_start=85
_globals['_MIMEDATA']._serialized_end=157
Expand Down
Loading