Documentation should include concrete, executable code examples rather than vague instructions. Make your examples copy-paste ready with all necessary context and dependencies. When documenting features or APIs, show exactly how they should be used in practice.
Documentation should include concrete, executable code examples rather than vague instructions. Make your examples copy-paste ready with all necessary context and dependencies. When documenting features or APIs, show exactly how they should be used in practice.
For example, instead of just stating:
// Don't do this
// You can pass provider options as an argument
Provide a complete, executable example:
// Do this
const result = await embed({
model: cohere.embedding('embed-english-v3.0'),
input: 'Hello world',
providerOptions: {
cohere: {
inputType: 'search_query'
}
}
});
For pre-release or alpha software, clearly state limitations and expectations (e.g., “not for production use”, “subject to breaking changes”). Always aim to create documentation that developers can immediately implement without needing to figure out missing pieces.
Enter the URL of a public GitHub repository