### Add and Run Examples Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Demonstrates how to add a new Python example script in the 'examples/' directory and make it executable. ```python # add an example to examples/.py #!/usr/bin/env -S rye run python … ``` ```sh $ chmod +x examples/.py # run the example against your api $ ./examples/.py ``` -------------------------------- ### Build and Install SDK from Source Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Builds a distributable wheel file for the Python SDK and installs it locally. ```sh $ rye build # or $ python -m build ``` ```sh $ pip install ./path-to-wheel-file.whl ``` -------------------------------- ### Install SDK from Git Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Installs the Python SDK directly from its Git repository using pip. ```sh $ pip install git+ssh://git@github.com/withpi/sdk-python.git ``` -------------------------------- ### Setup Environment with Rye Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Installs dependencies using Rye, a Python environment manager. It automatically provisions the correct Python version and syncs all features. ```sh $ ./scripts/bootstrap ``` ```sh $ rye sync --all-features ``` -------------------------------- ### Setup Environment without Rye using Pip Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Installs development dependencies using pip and a requirements lock file, for users who prefer not to use Rye. ```sh $ pip install -r requirements-dev.lock ``` -------------------------------- ### Run Tests with Mock Server Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Sets up a mock server using Prism against the OpenAPI specification to run tests for the SDK. ```sh # you will need npm installed $ npx prism mock path/to/your/openapi.yml ``` -------------------------------- ### Publish to PyPI Manually Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Publishes the Python package to PyPI manually by executing a script with a provided PYPI_TOKEN. ```sh bin/publish-pypi ``` -------------------------------- ### Run All Tests Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Executes all tests for the Python SDK using a provided script. ```sh $ ./scripts/test ``` -------------------------------- ### Lint and Format Code Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Applies linting and formatting rules using Ruff and Black to maintain code quality and consistency. ```sh $ ./scripts/lint ``` ```sh $ ./scripts/format ``` -------------------------------- ### Activate Virtual Environment with Rye Source: https://github.com/withpi/sdk-python/blob/main/CONTRIBUTING.md Activates the virtual environment created by Rye, allowing direct execution of Python scripts without the 'rye run' prefix. ```sh # Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work $ source .venv/bin/activate # now you can omit the `rye run` prefix $ python script.py ``` -------------------------------- ### Install Pi Client with aiohttp Support Source: https://github.com/withpi/sdk-python/blob/main/README.md Installs the Pi Client library with the optional aiohttp backend for improved concurrency. This requires installing the library with the `[aiohttp]` extra. ```sh pip install withpi[aiohttp] ``` -------------------------------- ### Install Pi Client Python Library Source: https://github.com/withpi/sdk-python/blob/main/README.md Installs the Pi Client library from PyPI using pip. This is the first step to using the library in your Python projects. ```sh pip install withpi ``` -------------------------------- ### Start Data Generation Job - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Starts a new data generation job with specified parameters. Returns the DataGenerationStatus of the newly created job. ```Python client.data.generate.start_job(**params) -> DataGenerationStatus ``` -------------------------------- ### Calibrate Start Job Source: https://github.com/withpi/sdk-python/blob/main/api.md Starts a new calibration job with specified parameters. This method corresponds to the POST /scoring_system/calibrate API endpoint. ```Python from withpi.types.shared.scoring_spec_calibration_status import ScoringSpecCalibrationStatus from withpi.types.scoring_system.calibrate_start_job_params import CalibrateStartJobParams # Assuming 'client' is an initialized Withpi client instance # params: CalibrateStartJobParams - Parameters for starting the calibration job status: ScoringSpecCalibrationStatus = client.scoring_system.calibrate.start_job(**params) ``` -------------------------------- ### Get Python SDK Version Source: https://github.com/withpi/sdk-python/blob/main/README.md This snippet demonstrates how to retrieve the currently installed version of the Python SDK at runtime. It imports the SDK and accesses the '__version__' attribute. ```Python import withpi print(withpi.__version__) ``` -------------------------------- ### Generate Start Job Source: https://github.com/withpi/sdk-python/blob/main/api.md Starts a new generation job with specified parameters. This method corresponds to the POST /scoring_system/generate API endpoint. ```Python from withpi.types.scoring_system.generate_start_job_response import GenerateStartJobResponse from withpi.types.scoring_system.generate_start_job_params import GenerateStartJobParams # Assuming 'client' is an initialized Withpi client instance # params: GenerateStartJobParams - Parameters for starting the generation job response: GenerateStartJobResponse = client.scoring_system.generate.start_job(**params) ``` -------------------------------- ### Start Input Response Pairs Job - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Initiates a new job for generating input-response pairs with specified parameters. Returns the SyntheticDataStatus of the new job. ```Python client.data.generate_input_response_pairs.start_job(**params) -> SyntheticDataStatus ``` -------------------------------- ### Asynchronous Pi Client Usage Source: https://github.com/withpi/sdk-python/blob/main/README.md Shows how to use the asynchronous AsyncPiClient for non-blocking API calls. It includes an example of making a scoring request within an async function and running it with asyncio. ```python import os import asyncio from withpi import AsyncPiClient client = AsyncPiClient( api_key=os.environ.get("WITHPI_API_KEY"), # This is the default and can be omitted ) async def main() -> None: scoring_system_metrics = await client.scoring_system.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ {"question": "Is this response truthful?"}, {"question": "Is this response relevant?"}, ], ) print(scoring_system_metrics.total_score) asyncio.run(main()) ``` -------------------------------- ### Calibrate List Jobs Source: https://github.com/withpi/sdk-python/blob/main/api.md Lists all calibration jobs with optional parameters for filtering. This method corresponds to the GET /scoring_system/calibrate API endpoint. ```Python from withpi.types.scoring_system import CalibrateListResponse from withpi.types.scoring_system.calibrate_list_params import CalibrateListParams # Assuming 'client' is an initialized Withpi client instance # params: CalibrateListParams - Optional parameters for filtering the list response: CalibrateListResponse = client.scoring_system.calibrate.list(**params) ``` -------------------------------- ### Import Shared Types - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Imports various shared data types from the withpi.types module, including status indicators, examples, and classification results. ```Python from withpi.types import ( DataGenerationStatus, Example, ExplorationMode, QueryClassifierResult, Question, ScoringSpecCalibrationStatus, ScoringSystemMetrics, SyntheticDataStatus, ) ``` -------------------------------- ### Differentiate Null vs. Missing Fields in Python Source: https://github.com/withpi/sdk-python/blob/main/README.md Provides a Python code example demonstrating how to use `.model_fields_set` to distinguish between a field explicitly set to `null` and a field that is entirely missing from an API response. ```Python if response.my_field is None: if 'my_field' not in response.model_fields_set: print('Got json like {}, without a "my_field" key present at all.') else: print('Got json like {"my_field": null}.') ``` -------------------------------- ### Access Raw Response Data with Python SDK Source: https://github.com/withpi/sdk-python/blob/main/README.md Demonstrates how to access the raw response object, including headers, from the WithPi Python SDK. It shows how to use `.with_raw_response.` to get an APIResponse object and parse its content. ```python from withpi import PiClient client = PiClient() response = client.scoring_system.with_raw_response.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ { "question": "Is this response truthful?" }, { "question": "Is this response relevant?" } ], ) print(response.headers.get('X-My-Header')) scoring_system = response.parse() # get the object that `scoring_system.score()` would have returned print(scoring_system.total_score) ``` -------------------------------- ### Generate List Jobs Source: https://github.com/withpi/sdk-python/blob/main/api.md Lists all generation jobs with optional parameters for filtering. This method corresponds to the GET /scoring_system/generate API endpoint. ```Python from withpi.types.scoring_system import GenerateListResponse from withpi.types.scoring_system.generate_list_params import GenerateListParams # Assuming 'client' is an initialized Withpi client instance # params: GenerateListParams - Optional parameters for filtering the list response: GenerateListResponse = client.scoring_system.generate.list(**params) ``` -------------------------------- ### Calibrate Retrieve Job Source: https://github.com/withpi/sdk-python/blob/main/api.md Retrieves the status of a calibration job using its job ID. This method corresponds to the GET /scoring_system/calibrate/{job_id} API endpoint. ```Python from withpi.types.shared.scoring_spec_calibration_status import ScoringSpecCalibrationStatus # Assuming 'client' is an initialized Withpi client instance # job_id: str - The ID of the calibration job to retrieve status: ScoringSpecCalibrationStatus = client.scoring_system.calibrate.retrieve(job_id) ``` -------------------------------- ### Calibrate Stream Messages Source: https://github.com/withpi/sdk-python/blob/main/api.md Streams messages related to a specific calibration job. This method corresponds to the GET /scoring_system/calibrate/{job_id}/messages API endpoint. ```Python # Assuming 'client' is an initialized Withpi client instance # job_id: str - The ID of the calibration job to stream messages from response: str = client.scoring_system.calibrate.stream_messages(job_id) ``` -------------------------------- ### Generate Retrieve Job Source: https://github.com/withpi/sdk-python/blob/main/api.md Retrieves the status of a generation job using its job ID. This method corresponds to the GET /scoring_system/generate/{job_id} API endpoint. ```Python from withpi.types.scoring_system.generate_retrieve_response import GenerateRetrieveResponse # Assuming 'client' is an initialized Withpi client instance # job_id: str - The ID of the generation job to retrieve response: GenerateRetrieveResponse = client.scoring_system.generate.retrieve(job_id) ``` -------------------------------- ### Generate Stream Messages Source: https://github.com/withpi/sdk-python/blob/main/api.md Streams messages related to a specific generation job. This method corresponds to the GET /scoring_system/generate/{job_id}/messages API endpoint. ```Python # Assuming 'client' is an initialized Withpi client instance # job_id: str - The ID of the generation job to stream messages from response: str = client.scoring_system.generate.stream_messages(job_id) ``` -------------------------------- ### Configure HTTP Client with Python SDK Source: https://github.com/withpi/sdk-python/blob/main/README.md Demonstrates how to configure the underlying httpx client for the WithPi Python SDK, including setting proxies, custom transports, and base URLs. It also shows how to override client options on a per-request basis using `with_options()`. ```python import httpx from withpi import PiClient, DefaultHttpxClient client = PiClient( # Or use the `PI_CLIENT_BASE_URL` env var base_url="http://my.test.server.example.com:8083", http_client=DefaultHttpxClient( proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), ) # Example of per-request customization # client.with_options(http_client=DefaultHttpxClient(...)) ``` -------------------------------- ### Async Pi Client with aiohttp Backend Source: https://github.com/withpi/sdk-python/blob/main/README.md Demonstrates using the AsyncPiClient with the aiohttp HTTP backend. This involves instantiating the client with `http_client=DefaultAioHttpClient()` and using an async context manager. ```python import asyncio from withpi import DefaultAioHttpClient from withpi import AsyncPiClient async def main() -> None: async with AsyncPiClient( api_key="My API Key", http_client=DefaultAioHttpClient(), ) as client: scoring_system_metrics = await client.scoring_system.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ {"question": "Is this response truthful?"}, {"question": "Is this response relevant?"}, ], ) print(scoring_system_metrics.total_score) asyncio.run(main()) ``` -------------------------------- ### Manage HTTP Resources with Python SDK Context Manager Source: https://github.com/withpi/sdk-python/blob/main/README.md Explains how to manage HTTP resources by using the WithPi Python SDK client as a context manager, ensuring that underlying HTTP connections are properly closed when exiting the context. ```python from withpi import PiClient with PiClient() as client: # make requests here pass # HTTP client is now closed ``` -------------------------------- ### Enable Logging with Environment Variable Source: https://github.com/withpi/sdk-python/blob/main/README.md Explains how to enable logging for the Python SDK by setting the `PI_CLIENT_LOG` environment variable to 'info' or 'debug'. ```Shell $ export PI_CLIENT_LOG=info ``` -------------------------------- ### Synchronous Pi Client Usage Source: https://github.com/withpi/sdk-python/blob/main/README.md Demonstrates how to initialize and use the synchronous PiClient to interact with the Pi Client REST API. It shows how to make a scoring request and access the total score. ```python import os from withpi import PiClient client = PiClient( api_key=os.environ.get("WITHPI_API_KEY"), # This is the default and can be omitted ) scoring_system_metrics = client.scoring_system.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ {"question": "Is this response truthful?"}, {"question": "Is this response relevant?"}, ], ) print(scoring_system_metrics.total_score) ``` -------------------------------- ### Configure Timeouts in Python SDK Source: https://github.com/withpi/sdk-python/blob/main/README.md Illustrates how to set default request timeouts or configure granular timeout settings (read, write, connect) using float values or `httpx.Timeout` objects. ```Python from withpi import PiClient import httpx # Configure the default for all requests: client = PiClient( # 20 seconds (default is 1 minute) timeout=20.0, ) # More granular control: client = PiClient( timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), ) # Override per-request: client.with_options(timeout=5.0).scoring_system.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ {"question": "Is this response truthful?"}, {"question": "Is this response relevant?"}, ], ) ``` -------------------------------- ### Handle API Errors with Python SDK Source: https://github.com/withpi/sdk-python/blob/main/README.md Demonstrates how to catch and handle different types of API errors, including connection errors, rate limit errors, and general status errors, using try-except blocks. ```Python import withpi from withpi import PiClient client = PiClient() try: client.scoring_system.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ {"question": "Is this response truthful?"}, {"question": "Is this response relevant?"}, ], ) except withpi.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. except withpi.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") except withpi.APIStatusError as e: print("Another non-200-range status code was received") print(e.status_code) print(e.response) ``` -------------------------------- ### Make Undocumented Requests with Python SDK Source: https://github.com/withpi/sdk-python/blob/main/README.md Shows how to make requests to undocumented endpoints or send custom parameters and headers using the WithPi Python SDK's `client.post` method and `extra_query`, `extra_body`, `extra_headers` options. ```python import httpx from withpi import PiClient client = PiClient() response = client.post( "/foo", cast_to=httpx.Response, body={"my_param": True}, ) print(response.headers.get("x-foo")) ``` -------------------------------- ### Configure Retries in Python SDK Source: https://github.com/withpi/sdk-python/blob/main/README.md Shows how to configure the default number of retries for API requests or override it on a per-request basis using `max_retries`. ```Python from withpi import PiClient # Configure the default for all requests: client = PiClient( # default is 2 max_retries=0, ) # Or, configure per-request: client.with_options(max_retries=5).scoring_system.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ {"question": "Is this response truthful?"}, {"question": "Is this response relevant?"}, ], ) ``` -------------------------------- ### Upload Scoring System to Huggingface - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Uploads the scoring system to Huggingface using provided parameters. Returns a string indicating the upload status. ```Python client.scoring_system.upload_to_huggingface(**params) -> str ``` -------------------------------- ### Import Scoring System Specification - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Imports a scoring system specification using provided parameters. Returns a ScoringSystemImportSpecResponse object. ```Python client.scoring_system.import_spec(**params) -> ScoringSystemImportSpecResponse ``` -------------------------------- ### Stream Response Data with Python SDK Source: https://github.com/withpi/sdk-python/blob/main/README.md Illustrates how to stream response data using the `.with_streaming_response.` context manager in the WithPi Python SDK. This method allows for reading the response body incrementally. ```python from withpi import PiClient client = PiClient() with client.scoring_system.with_streaming_response.score( llm_input="Tell me something different", llm_output="The lazy dog was jumped over by the quick brown fox", scoring_spec=[ {"question": "Is this response truthful?"}, {"question": "Is this response relevant?"}, ], ) as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): print(line) ``` -------------------------------- ### List Data Generation Jobs - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Lists all data generation jobs, optionally filtered by provided parameters. Returns a GenerateListResponse object. ```Python client.data.generate.list(**params) -> GenerateListResponse ``` -------------------------------- ### Import Scoring System Types - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Imports types for scoring system operations, including responses for importing specifications and uploading to Huggingface. ```Python from withpi.types import ScoringSystemImportSpecResponse, ScoringSystemUploadToHuggingfaceResponse ``` -------------------------------- ### List Input Response Pairs Jobs - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Lists jobs for generating input-response pairs, with optional filtering parameters. Returns a GenerateInputResponsePairListResponse object. ```Python client.data.generate_input_response_pairs.list(**params) -> GenerateInputResponsePairListResponse ``` -------------------------------- ### Import Data Input Response Pairs Types - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Imports types specific to generating input-response pairs, including list, cancel, and stream data/messages responses. ```Python from withpi.types.data import ( GenerateInputResponsePairListResponse, GenerateInputResponsePairCancelResponse, GenerateInputResponsePairStreamDataResponse, GenerateInputResponsePairStreamMessagesResponse, ) ``` -------------------------------- ### Score with Scoring System - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Scores data using the scoring system with specified parameters. Returns ScoringSystemMetrics. ```Python client.scoring_system.score(**params) -> ScoringSystemMetrics ``` -------------------------------- ### Stream Data Generation Data - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Streams the generated data for a specific data generation job. Returns the data as a string. ```Python client.data.generate.stream_data(job_id) -> str ``` -------------------------------- ### Import Data Generation Types - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Imports specific types related to data generation responses, such as list responses, cancel responses, and stream data/messages responses. ```Python from withpi.types.data import ( GenerateListResponse, GenerateCancelResponse, GenerateStreamDataResponse, GenerateStreamMessagesResponse, ) ``` -------------------------------- ### Search Embeddings Source: https://github.com/withpi/sdk-python/blob/main/api.md Generates embeddings for given text or data. This method corresponds to the POST /search/embed API endpoint. ```Python from withpi.types.search_embed_response import SearchEmbedResponse from withpi.types.search_embed_params import SearchEmbedParams # Assuming 'client' is an initialized Withpi client instance # params: SearchEmbedParams - Parameters for embedding generation response: SearchEmbedResponse = client.search.embed(**params) ``` -------------------------------- ### Stream Data Generation Messages - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Streams messages related to a data generation job. Returns the messages as a string. ```Python client.data.generate.stream_messages(job_id) -> str ``` -------------------------------- ### QueryClassifier Classify Source: https://github.com/withpi/sdk-python/blob/main/api.md Classifies a query using the QueryClassifier. This method corresponds to the POST /search/query_classifier/classify API endpoint. ```Python from withpi.types.search.query_classifier_classify_response import QueryClassifierClassifyResponse from withpi.types.search.query_classifier_classify_params import QueryClassifierClassifyParams # Assuming 'client' is an initialized Withpi client instance # params: QueryClassifierClassifyParams - Parameters for query classification response: QueryClassifierClassifyResponse = client.search.query_classifier.classify(**params) ``` -------------------------------- ### Groundedness Check Source: https://github.com/withpi/sdk-python/blob/main/api.md Performs a groundedness check. This method corresponds to the POST /search/groundedness/check API endpoint. ```Python from withpi.types.search.groundedness_check_response import GroundednessCheckResponse from withpi.types.search.groundedness_check_params import GroundednessCheckParams # Assuming 'client' is an initialized Withpi client instance # params: GroundednessCheckParams - Parameters for the groundedness check response: GroundednessCheckResponse = client.search.groundedness.check(**params) ``` -------------------------------- ### Retrieve Input Response Pairs Job - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Retrieves the status of a job for generating input-response pairs using its job ID. Returns a SyntheticDataStatus object. ```Python client.data.generate_input_response_pairs.retrieve(job_id) -> SyntheticDataStatus ``` -------------------------------- ### Stream Input Response Pairs Messages - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Streams messages associated with an input-response pairs job. Returns the messages as a string. ```Python client.data.generate_input_response_pairs.stream_messages(job_id) -> str ``` -------------------------------- ### Stream Input Response Pairs Data - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Streams the generated data for an input-response pairs job. Returns a GenerateInputResponsePairStreamDataResponse object. ```Python client.data.generate_input_response_pairs.stream_data(job_id) -> GenerateInputResponsePairStreamDataResponse ``` -------------------------------- ### Retrieve Data Generation Job - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Retrieves the status of a specific data generation job using its job ID. This method returns a DataGenerationStatus object. ```Python client.data.generate.retrieve(job_id) -> DataGenerationStatus ``` -------------------------------- ### Search Rank Passages Source: https://github.com/withpi/sdk-python/blob/main/api.md Ranks passages based on a query. This method corresponds to the POST /search/query_to_passage/score API endpoint. ```Python from withpi.types.search_rank_response import SearchRankResponse from withpi.types.search_rank_params import SearchRankParams # Assuming 'client' is an initialized Withpi client instance # params: SearchRankParams - Parameters for ranking passages response: SearchRankResponse = client.search.rank(**params) ``` -------------------------------- ### Cancel Input Response Pairs Job - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Cancels a job for generating input-response pairs using its job ID. Returns a string indicating the cancellation status. ```Python client.data.generate_input_response_pairs.cancel(job_id) -> str ``` -------------------------------- ### Cancel Data Generation Job - Python Source: https://github.com/withpi/sdk-python/blob/main/api.md Cancels a running data generation job identified by its job ID. Returns a string indicating the cancellation status. ```Python client.data.generate.cancel(job_id) -> str ``` -------------------------------- ### Calibrate Cancel Job Source: https://github.com/withpi/sdk-python/blob/main/api.md Cancels an ongoing calibration job using its job ID. This method corresponds to the DELETE /scoring_system/calibrate/{job_id} API endpoint. ```Python # Assuming 'client' is an initialized Withpi client instance # job_id: str - The ID of the calibration job to cancel response: str = client.scoring_system.calibrate.cancel(job_id) ``` -------------------------------- ### Generate Cancel Job Source: https://github.com/withpi/sdk-python/blob/main/api.md Cancels an ongoing generation job using its job ID. This method corresponds to the DELETE /scoring_system/generate/{job_id} API endpoint. ```Python # Assuming 'client' is an initialized Withpi client instance # job_id: str - The ID of the generation job to cancel response: str = client.scoring_system.generate.cancel(job_id) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.