Loading...
Loading...
Help users add knowledge base documents to Runway Characters for domain-specific conversations
npx skill4agent add runwayml/skills integrate-documentsPREREQUISITE: Runfirst. Run+check-compatibilityto load the latest API reference before integrating.+fetch-api-reference— API credentials must be configured+setup-api-keyUSED BY:— Documents are linked to Avatars to give them domain-specific knowledge+integrate-characters
| Use Case | Example Content |
|---|---|
| Customer support | FAQs, product info, company policies, return procedures |
| Quizzes & games | Question banks, correct answers, scoring rules |
| Education | Course material, reference content, learning objectives |
| Brand experiences | Brand guidelines, messaging, product catalogs |
import RunwayML from '@runwayml/sdk';
const client = new RunwayML();
const document = await client.documents.create({
name: 'Product FAQ',
content: `# Product FAQ
## What is your return policy?
We offer a 30-day return policy for all unused items in original packaging.
## How do I track my order?
Log in to your account and visit the Orders page. You'll find tracking information for all shipped orders.
## Do you offer international shipping?
Yes, we ship to over 50 countries. Shipping costs and delivery times vary by destination.`,
});
console.log('Document created:', document.id);from runwayml import RunwayML
client = RunwayML()
document = client.documents.create(
name='Product FAQ',
content="""# Product FAQ
## What is your return policy?
We offer a 30-day return policy for all unused items in original packaging.
## How do I track my order?
Log in to your account and visit the Orders page.
## Do you offer international shipping?
Yes, we ship to over 50 countries.""",
)
print('Document created:', document.id)await client.avatars.update(avatarId, {
documentIds: [document.id],
});client.avatars.update(
avatar_id,
document_ids=[document.id],
)const faq = await client.documents.create({
name: 'FAQ',
content: '...',
});
const policies = await client.documents.create({
name: 'Company Policies',
content: '...',
});
await client.avatars.update(avatarId, {
documentIds: [faq.id, policies.id],
});const session = await client.realtimeSessions.create({
model: 'gwm1_avatars',
avatar: {
type: 'custom',
avatarId: avatarId,
},
});session = client.realtime_sessions.create(
model='gwm1_avatars',
avatar={
'type': 'custom',
'avatar_id': avatar_id,
},
)+integrate-charactersimport fs from 'fs';
import RunwayML from '@runwayml/sdk';
const client = new RunwayML();
// Read a local markdown file
const content = fs.readFileSync('./knowledge/product-faq.md', 'utf-8');
const document = await client.documents.create({
name: 'Product FAQ',
content,
});from pathlib import Path
from runwayml import RunwayML
client = RunwayML()
content = Path('./knowledge/product-faq.md').read_text()
document = client.documents.create(
name='Product FAQ',
content=content,
)// Example: API endpoint to update character knowledge
app.post('/api/avatar/update-knowledge', async (req, res) => {
const { avatarId, documents } = req.body;
// Create new documents
const docIds = [];
for (const doc of documents) {
const created = await client.documents.create({
name: doc.name,
content: doc.content,
});
docIds.push(created.id);
}
// Link all documents to the avatar (replaces existing)
await client.avatars.update(avatarId, {
documentIds: docIds,
});
res.json({ success: true, documentCount: docIds.length });
});