Skip to content

Commit 77d6169

Browse files
authored
Merge pull request #161 from objectstack-ai/copilot/create-example-folders
2 parents 5d6829b + c158c94 commit 77d6169

File tree

78 files changed

+1645
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1645
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# ObjectStack AI Protocol Examples
2+
3+
This package contains comprehensive examples demonstrating all aspects of the ObjectStack AI Protocol.
4+
5+
## 📚 What's Included
6+
7+
### Core Examples
8+
9+
1. **agent.examples.ts** - AI agent configuration examples
10+
- Conversational agents
11+
- Task-specific agents
12+
- Multi-agent systems
13+
- Agent tools and capabilities
14+
15+
2. **conversation.examples.ts** - Conversation management examples
16+
- Chat interfaces
17+
- Message threading
18+
- Context management
19+
- Conversation history
20+
21+
3. **cost.examples.ts** - Cost tracking examples
22+
- Token usage tracking
23+
- Cost allocation
24+
- Budget management
25+
- Usage analytics
26+
27+
4. **model-registry.examples.ts** - Model registry examples
28+
- Model configurations
29+
- Provider settings
30+
- Model capabilities
31+
- Fallback strategies
32+
33+
5. **nlq.examples.ts** - Natural Language Query examples
34+
- Text-to-SQL generation
35+
- Query understanding
36+
- Semantic search
37+
- Intent recognition
38+
39+
6. **orchestration.examples.ts** - AI orchestration examples
40+
- Multi-step workflows
41+
- Agent coordination
42+
- Task routing
43+
- Error handling
44+
45+
7. **predictive.examples.ts** - Predictive analytics examples
46+
- Forecasting models
47+
- Classification
48+
- Regression
49+
- Anomaly detection
50+
51+
8. **rag-pipeline.examples.ts** - RAG pipeline examples
52+
- Document indexing
53+
- Vector search
54+
- Context retrieval
55+
- Answer generation
56+
57+
## 🚀 Usage
58+
59+
```typescript
60+
import {
61+
SalesAssistantAgent,
62+
CustomerConversation,
63+
CostTracker,
64+
OpenAIModel,
65+
NaturalLanguageQuery,
66+
AgentOrchestration,
67+
SalesForecast,
68+
DocumentRAGPipeline,
69+
} from '@objectstack/example-ai';
70+
```
71+
72+
## 🏗️ Building
73+
74+
```bash
75+
npm run build
76+
```
77+
78+
This compiles all TypeScript examples to JavaScript and generates type declarations.
79+
80+
## 📖 Example Structure
81+
82+
Each example follows this pattern:
83+
- Descriptive constant name (e.g., `SalesAssistantAgent`)
84+
- Comprehensive JSDoc comment explaining the use case
85+
- Complete, valid example using proper schemas
86+
- Realistic, practical scenarios
87+
88+
## 🎯 Use Cases
89+
90+
These examples are designed for:
91+
- **Learning**: Understand ObjectStack AI Protocol patterns
92+
- **Reference**: Copy-paste starting points for your own metadata
93+
- **Testing**: Validate implementations against standard patterns
94+
- **Documentation**: Illustrate best practices and conventions
95+
96+
## 📝 Naming Conventions
97+
98+
- **Configuration Keys**: camelCase (e.g., `modelName`, `maxTokens`)
99+
- **Machine Names**: snake_case (e.g., `sales_agent`, `rag_pipeline`)
100+
- **Example Constants**: PascalCase (e.g., `SalesAgent`, `RAGPipeline`)
101+
102+
## 🔗 Related
103+
104+
- [ObjectStack Spec](../../../packages/spec) - Core schema definitions
105+
- [Data Examples](../../data/metadata-examples) - Data Protocol examples
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@objectstack/example-ai",
3+
"version": "1.0.0",
4+
"description": "Comprehensive AI Protocol examples demonstrating Agents, Conversations, Models, NLQ, Orchestration, Predictive Analytics, and RAG Pipelines",
5+
"private": true,
6+
"scripts": {
7+
"build": "tsc",
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"dependencies": {
11+
"@objectstack/spec": "workspace:*"
12+
},
13+
"devDependencies": {
14+
"typescript": "^5.0.0"
15+
}
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Agent Examples
3+
*
4+
* This file contains examples demonstrating AI Agent configurations
5+
* in the ObjectStack AI Protocol.
6+
*/
7+
8+
// TODO: Add agent examples
9+
// Example: ConversationalAgent, TaskAgent, MultiAgentSystem
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Conversation Examples
3+
*
4+
* This file contains examples demonstrating Conversation configurations
5+
* in the ObjectStack AI Protocol.
6+
*/
7+
8+
// TODO: Add conversation examples
9+
// Example: ChatInterface, MessageThreading, ContextManagement
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Cost Examples
3+
*
4+
* This file contains examples demonstrating Cost Tracking configurations
5+
* in the ObjectStack AI Protocol.
6+
*/
7+
8+
// TODO: Add cost tracking examples
9+
// Example: TokenUsageTracking, CostAllocation, BudgetManagement
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// @ts-nocheck
2+
/**
3+
* ObjectStack AI Protocol Examples
4+
*
5+
* This module exports comprehensive examples demonstrating all aspects
6+
* of the ObjectStack AI Protocol.
7+
*
8+
* @packageDocumentation
9+
*/
10+
11+
// Agent Examples
12+
export * from './agent.examples';
13+
14+
// Conversation Examples
15+
export * from './conversation.examples';
16+
17+
// Cost Examples
18+
export * from './cost.examples';
19+
20+
// Model Registry Examples
21+
export * from './model-registry.examples';
22+
23+
// NLQ Examples
24+
export * from './nlq.examples';
25+
26+
// Orchestration Examples
27+
export * from './orchestration.examples';
28+
29+
// Predictive Examples
30+
export * from './predictive.examples';
31+
32+
// RAG Pipeline Examples
33+
export * from './rag-pipeline.examples';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Model Registry Examples
3+
*
4+
* This file contains examples demonstrating Model Registry configurations
5+
* in the ObjectStack AI Protocol.
6+
*/
7+
8+
// TODO: Add model registry examples
9+
// Example: OpenAIModel, AnthropicModel, CustomModel, FallbackStrategy
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* NLQ Examples
3+
*
4+
* This file contains examples demonstrating Natural Language Query configurations
5+
* in the ObjectStack AI Protocol.
6+
*/
7+
8+
// TODO: Add NLQ examples
9+
// Example: TextToSqlQuery, SemanticSearch, IntentRecognition
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Orchestration Examples
3+
*
4+
* This file contains examples demonstrating AI Orchestration configurations
5+
* in the ObjectStack AI Protocol.
6+
*/
7+
8+
// TODO: Add orchestration examples
9+
// Example: MultiStepWorkflow, AgentCoordination, TaskRouting
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Predictive Examples
3+
*
4+
* This file contains examples demonstrating Predictive Analytics configurations
5+
* in the ObjectStack AI Protocol.
6+
*/
7+
8+
// TODO: Add predictive analytics examples
9+
// Example: ForecastingModel, Classification, Regression, AnomalyDetection

0 commit comments

Comments
 (0)