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

**Sam Julien**  |  March 13, 2025

TL;DR by [WRITER](/content/site-root.html)

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](https://dev.writer.com/api-guides/model-delegation) 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](https://dev.writer.com/api-guides/kg-chat), 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 X4 to delegate these questions to Palmyra Fin.

Python

```makefile
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-X4",
    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](https://dev.writer.com/api-guides/model-delegation).

## 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](https://dev.writer.com/api-guides/api-reference/application-api/list-applications):

Python

```makefile
page = client.applications.list()

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

Or [for one application](https://dev.writer.com/api-guides/api-reference/application-api/application-details):

Python

```python
application = client.applications.retrieve(
    "application_id",
)

print(application.id)
```

This functionality pairs nicely with our guide on using [no-code applications as tools](https://dev.writer.com/api-guides/applications-tool-calling), 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](https://dev.writer.com/api-guides/api-reference/application-api/generate-application-job) and [retrieve](https://dev.writer.com/api-guides/api-reference/application-api/get-single-async-job) or [retry](https://dev.writer.com/api-guides/api-reference/application-api/post-retry-async-job) the job later. This is great for long-running no-code applications, such as [research assistant applications](https://dev.writer.com/no-code/building-a-research-assistant-app).

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

Python

```lua
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](https://dev.writer.com/api-guides/async-applications).

## Associating Knowledge Graphs with chat applications

Finally, you can now also [retrieve](https://dev.writer.com/api-guides/api-reference/application-api/get-application-graphs) or [update](https://dev.writer.com/api-guides/api-reference/application-api/put-application-graphs) which Knowledge Graphs are associated with no-code chat applications.

Python

```makefile
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_](https://dev.writer.com/api-guides/changelog#2025-02-27) _for more information._

Check out the full [API and SDK documentation](https://dev.writer.com/api-guides/introduction) for more guides and API reference documentation.
