Back to the knowledge base
ArticlesBuild with AICurioFuse editorial

Continue an interrupted DeepSeek reply

Check whether continuation is supported before sending the partial answer back.

A folded cream paper ribbon continues as a turquoise ribbon across a small gap, beside autumn leaves.
CurioFuse · AI-generated illustration
In this article

Prepare a prefix

The prefix guide is for developers making API calls. A prefix is the beginning you supply for the assistant to continue. With your API key, configure the example’s client for https://api.deepseek.com/beta and use deepseek-flash. Put the partial text in the final assistant message and set prefix to true. Our practice input: request a short fictional autumn poem and supply ‘The leaves gather’ as its opening. Inspect the message order before sending. This is a proposed exercise, not a recorded model test.

Read the stopping reason

In the response schema, finish_reason describes why generation ended. A stop value can mean either a natural ending or your chosen stopping sequence. Length identifies a token-limit ending in that field’s definition. Content filtering, tool calls, resource shortages and interruption have separate values. Our suggested result check: read this field alongside message.content, then explain why the text ended. Do not treat every ending as the same condition or infer poem quality from that status.

Check the continuation boundary

The continuation rules say the response contains only the newly generated portion. For this exercise, inspect that portion alongside your supplied opening. A reply that used deepseek_web_search or deepseek_read_url cannot be continued: resend the previous request instead. The Responses API does not support this continuation. Check the actual protocol and prior tool use before choosing the next request.

Sources(3)

Original CurioFuse editorial. A guide to explore and evaluate AI, without an implied product test.

Sources & standardsReport a correction