When documenting AI integrations, provide comprehensive examples that showcase all common initialization and usage patterns. Documentation should include:
When documenting AI integrations, provide comprehensive examples that showcase all common initialization and usage patterns. Documentation should include:
.fromDocuments
, etc.)For example, when documenting a vector store integration:
// Show direct initialization
const vectorStore = new AIVectorStore(new SomeEmbeddings());
// Also show initialization from documents
const documents = [new Document({ pageContent: "text" })];
const vectorStoreFromDocs = await AIVectorStore.fromDocuments(
documents,
new SomeEmbeddings()
);
// Demonstrate common operations
const results = await vectorStore.similaritySearch("query", 5);
This practice ensures developers can quickly understand and implement AI integrations without needing to search through multiple documentation pages or source code.
Enter the URL of a public GitHub repository