Rewrite
Transform text per optional instructions and context. Returns only the new text.
Signature
1rewrite(text: string, instructions?: string, useContext?: boolean): Promise<string>
Basic rewrite
1const out = await agent.rewrite('pls help me i cant sync');
2
3console.log(out);
With instructions
1await agent.rewrite('I cannot sync the wearable', 'Shorten and use neutral tone');
With context
1await agent.rewrite('battery died fast', undefined, true);
Common issues
- Empty text.
- Non-string instructions.
- Balance exhausted.