SDK Responses
See what a typical response from the Payman SDK looks like and how to use it.
When you call payman.ask()
in your code, you receive a structured response object. This object contains not only the main answer to your prompt, but also useful metadata for tracking, auditing, and advanced workflows.
Example Response
Here is a real-world example of a response you might get from the SDK:
Key Fields
-
content (inside
artifacts
):This is the main answer to your prompt. For most use cases, you will display or process this field in your app.
-
status: Indicates if the request was completed, failed, or is still in progress.
-
sessionId: Used to track and resume conversations or workflows.
-
taskId and requestId: Useful for debugging, logging, or support.
-
metadata: Contains additional context about the agent, organization, and timestamps.
How to Use the Response
In your code, you typically want to extract the main answer from the first artifact:
If you use streaming, you will receive updates to the artifacts as they are
generated. For most synchronous use cases, just use the first artifact’s
content
.
If you need to debug or audit, you can log the full response object. For
most user-facing features, just show the content
field.