# I need to generate the content response without truncate

**URL:** <https://community.perplexity.ai/t/i-need-to-generate-the-content-response-without-truncate/1968>\
**Category:** General\
**Tags:** sonar-api\
**Created:** [October 10, 2025, 5:40pm UTC](https://community.perplexity.ai/t/i-need-to-generate-the-content-response-without-truncate/1968 "2025-10-10T17:40:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suresh\_Chilakala](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/suresh_chilakala/32/502_2.png) [@Suresh\_Chilakala](https://community.perplexity.ai/u/Suresh_Chilakala)\
**Post date:** [October 10, 2025, 5:40pm UTC](https://community.perplexity.ai/t/i-need-to-generate-the-content-response-without-truncate/1968/1 "2025-10-10T17:40:36Z")

</div>

I have implemented the code with this prompt to generate the content with token limit 400.but i want to generate the content with token limit 400 without truncate the response. below is the prompt is i am using

a targeted list of business networking events in {location} that are relevant for a professional with the job title {job\_title}.  
Focus the results on events where \*\*{job\_title}\*\*s offering {services} in the {industry} industry can connect with potential clients.  
Prioritize events in {city}, {state} where attendees include individuals with {target\_client\_job\_titles} in {target\_client\_industries}.  
Recommendations should be current, locally accessible, and specifically drive business growth and new client introductions for \*\*{job\_title}\*\*s in {industry}.

```auto
    IMPORTANT:
    - Respond ONLY in raw HTML.
    - Do NOT wrap the HTML inside backticks or code blocks.
    - Do NOT include Markdown formatting.
    - Use <h5><b>...</b></h5> for main section headings (for example, Professional Organizations and Chambers).
    - Use <ul> and <li> for bullet points.
    - When listing individual organizations, use a bold tag <b> for the organization name or subheading (for example, <b>The Woodlands Area Chamber of Commerce:</b>).
    - Do NOT use <em>, or <i> tags.
    - Do 

```

Can you please provide the prompt without truncate the response with that max token limit??

---

<div class="post-metadata">

**Author:** ![Kesku](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/kesku/32/898_2.png) [@Kesku](https://community.perplexity.ai/u/Kesku)\
**Post date:** [October 22, 2025, 2:09am UTC](https://community.perplexity.ai/t/i-need-to-generate-the-content-response-without-truncate/1968/2 "2025-10-22T02:09:27Z")

</div>

> [@Suresh\_Chilakala](#):
>
> Can you please provide the prompt without truncate the response with that max token limit??

You can’t force a model to fit _exactly_ within a token limit without potential truncation.

If you want to generate longer, complete responses, adjust the **`max_tokens`** parameter in your API request instead of trying to constrain it in the prompt itself. For example:

```python
response = client.chat.completions.create(
    model="sonar-pro",
    messages=[{"role": "user", "content": prompt}],
    max_tokens=400 # adjust this value
)

```

`max_tokens` defines the maximum number of tokens _the model is allowed to generate_, not a fixed length — so if the output needs to be complete, set this high enough (e.g. 800–1000) and handle truncation logic on your side if needed.
