A software development kit (SDK) gives application developers a consistent interface to a platform’s services. For a distributed AI platform, the SDK turns Python method calls into coordinated network requests, so workflow code can focus on application logic rather than service boundaries and connection details. section 2.1.8 section 2.5
The SDK’s runtime entry point, GenAIPlatform, holds gateway connection configuration and exposes service-specific clients. Clients are created lazily: accessing platform.sessions constructs a SessionClient on first use and returns the cached instance thereafter. This avoids opening connections for services a workflow does not use. section 2.5 section 2.5.2
Figure 2.7 When Sarah's workflow calls a platform service, the SDK lazily initializes the appropriate client on first access, establishes a gRPC channel to the gateway with service-specific metadata, constructs Protocol Buffer requests, and converts responses back to Python objects. The gateway reads the x-target-service metadata to route requests to the correct service without deserializing the binary data

Follow a service call from lazy client creation through gateway routing and response conversion. section 2.5.2
A client opens a secure gRPC channel to the API gateway and attaches routing metadata such as x-target-service: sessions. It builds a Protocol Buffer request, calls the generated service stub, and converts the response into a Python object. The gateway routes the request; the backend service performs the work. The call may look local, but it is still a network request. section 2.5.2 section 2.5.4
A shared BaseClient can centralize channel and routing setup, while individual clients provide service-specific stubs and methods. The same pattern supports session operations, model calls, and data searches without requiring developers to learn a different connection mechanism for each service. section 4.5 section 2.5.4
A workflow using the SDK
A patient intake workflow creates GenAIPlatform, calls platform.sessions.get_or_create(patient_id), and uses platform.models.chat to generate a response. The @workflow decorator captures deployment configuration that a deployment tool uses to package and register the function. section 2.5
Listing 2.15 Simple workflow demonstrating SDK structure
platform = GenAIPlatform() #A
@workflow( #B
name="patient_intake_assistant", #B
api_path="/patient-assistant" #B
) #B
def handle_patient_question(question, patient_id): #B
session = platform.sessions.get_or_create(patient_id) #C
response = platform.models.chat( #C
model="gpt-4o",
system_prompt_name="patient_intake_assistant",
messages=[{"role": "user", "content": question}],
)
return {"response": response.content, "session_id": session.session_id}See the workflow entry point, deployment decorator, and service calls together. section 2.5
The interface can also expose managed capabilities. A team registers a scheduling tool with its endpoint, parameters, behavior, and rate limits; authorized applications can then discover its definition and pass it to model function calling without writing the schema manually. section 6.1.3

