Product updates

– 4 min read

Writer SDK 2.0 release: async jobs, model delegation, and more

Sam Julien

Sam Julien   |  March 13, 2025

Writer SDK 2.0 release: async jobs, model delegation, and more

TL;DR by Writer

SDK 2.0 introduces several new features, such as methods for retrieving application details, initiating asynchronous jobs, and associating Knowledge Graphs with chat applications. A notable addition is the model delegation tool, which allows you to automatically send domain-specific requests to specialized models. This release enhances the developer experience and sets the stage for future enhancements like streaming helpers that’ll be featured in an upcoming release.

SDK 2.0 is here with a host of new features, including new methods for retrieving applications, kicking off async jobs, and associating Knowledge Graphs with chat applications. It even has a new model delegation tool that lets you automatically send requests to domain-specific models as tool calls. We’ve also migrated to a new underlying TypeScript SDK structure, which reduces dependencies and fixes some bugs, improving your developer experience. This release sets the stage for streaming helpers, coming soon in an upcoming version.

Model delegation tool

Like our pre-built RAG tool, the new model delegation tool is a pre-built, remotely executed tool that lets you delegate domain-specific requests to the appropriate model. For example, if your application has finance questions, you can use the tool to allow Palmyra X 004 to delegate these questions to Palmyra Fin.

Python
tools = [{
    "type": "llm",
    "function": {
        "description": "A model specialized for financial risk assessment",
        "model": "palmyra-fin"
    }
}]

messages = [{"role": "user", "content": "Analyze the risk factors for our Q4 investment portfolio."}]

response = client.chat.chat(
    model="palmyra-x-004", 
    messages=messages, 
    tools=tools, 
    tool_choice="auto",
    stream=True
)

response_text = ""
for chunk in response:
    if chunk.choices[0].delta.content is not None:
        response_text += chunk.choices[0].delta.content

print(response_text)

Read more in our model delegation guide.

Retrieve application details

You can now retrieve details for all of your no-code applications, letting you programmatically retrieve inputs rather than relying on the AI Studio UI.

You can retrieve these details either as a list:

Python
page = client.applications.list()

page = page.data[0]
print(page.id)

Or for one application:

Python
application = client.applications.retrieve(
    "application_id",
)

print(application.id)

This functionality pairs nicely with our guide on using no-code applications as tools, as you can now programmatically create tool calls for no-code applications using just the application ID.

Asynchronous jobs

You can now trigger no-code applications asynchronously and retrieve or retry the job later. This is great for long-running no-code applications, such as research assistant applications.

To start an asynchronous job for a no-code application, you can use the new applications.jobs.create method:

Python
job = client.applications.jobs.create(
    application_id="application_id",
    inputs=[{
        "id": "id",
        "value": ["string"],
    }],
)

print(job.id)

To learn more, check out the guide on async jobs.

Associating Knowledge Graphs with chat applications

Finally, you can now also retrieve or update which Knowledge Graphs are associated with no-code chat applications.

Python
application_graphs_response = client.applications.graphs.list(
    "application_id",
)

application_graphs_response = client.applications.graphs.update(
    application_id="application_id",
    graph_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)

print(application_graphs_response

Get started

To try out the Writer SDK 2.0, run:

pip install writer-sdk

Or, for TypeScript:

npm install writer-sdk

Note: This release includes some breaking changes to the underlying models used in chat completion. This won’t affect you if you’re only using the chat completion method, but it will affect you if you’re importing specific types. See the release notes for more information.

Check out the full API and SDK documentation for more guides and API reference documentation.