After creating your AI service, you can test the coding logic of your AI service by using the watsonx.ai Python client library.
Testing AI services with Python client library
Copy link to section
To test the logic of your AI service locally by using the RuntimeContext class of the watsonx.ai Python client library, follow these steps:
Use the RuntimeContext class of the Python client library to test your AI service locally:
from ibm_watsonx_ai.deployments import RuntimeContext
context = RuntimeContext(
api_client=client, request_payload_json={}
)
# custom is optional argument which is specified during the time of creation of deployment
custom_object = {"space_id": space_id}
generate, generate_stream, generate_batch = basic_generate_demo(context, **custom_object)
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.