Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 42 additions & 77 deletions .github/CODE_GENERATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,28 @@ from ai_projects.llm_maker.src.tool_maker import ToolMaker

maker = ToolMaker()
code = maker.create_tool(
'validate_email',
'Validates email format using regex',
{'email': 'str'},
{'is_valid': 'bool'},
max_attempts=3
"validate_email", "Validates email format using regex", {"email": "str"}, {"is_valid": "bool"}, max_attempts=3
)

# Use the generated code:
exec(code)
print(validate_email('user@example.com')) # True
print(validate_email("user@example.com")) # True
```

### Example 2: Generate Data Processing Function

```python
maker = ToolMaker()
code = maker.create_tool(
'parse_csv_line',
'Parse a CSV line into a list of values',
{'line': 'str', 'delimiter': 'str'},
{'values': 'list'},
max_attempts=3
"parse_csv_line",
"Parse a CSV line into a list of values",
{"line": "str", "delimiter": "str"},
{"values": "list"},
max_attempts=3,
)

exec(code)
print(parse_csv_line('a,b,c', ',')) # ['a', 'b', 'c']
print(parse_csv_line("a,b,c", ",")) # ['a', 'b', 'c']
```

### Example 3: Generate Static Website
Expand All @@ -127,17 +123,15 @@ from ai_projects.llm_maker.src.website_maker import WebsiteMaker

maker = WebsiteMaker()
result = maker.create_website(
'blog-template',
['index.html', 'post.html', 'about.html'],
'A minimalist blog template with dark mode'
"blog-template", ["index.html", "post.html", "about.html"], "A minimalist blog template with dark mode"
)

# Check result
print(result['files'].keys()) # dict_keys(['index.html', 'style.css', ...])
print(result["files"].keys()) # dict_keys(['index.html', 'style.css', ...])

# Write files
for filename, content in result['files'].items():
with open(f"build/{filename}", 'w') as f:
for filename, content in result["files"].items():
with open(f"build/{filename}", "w") as f:
f.write(content)
```

Expand All @@ -164,12 +158,7 @@ Generate a validated Python function.
**Example:**

```python
code = maker.create_tool(
'reverse_string',
'Reverses a string',
{'text': 'str'},
{'reversed': 'str'}
)
code = maker.create_tool("reverse_string", "Reverses a string", {"text": "str"}, {"reversed": "str"})
```

### WebsiteMaker
Expand All @@ -193,12 +182,10 @@ Generate a complete static website.

```python
result = maker.create_website(
'landing-page',
['index.html', 'features.html'],
'Marketing landing page for SaaS product'
"landing-page", ["index.html", "features.html"], "Marketing landing page for SaaS product"
)

for filename, content in result['files'].items():
for filename, content in result["files"].items():
print(f"Generated {filename}: {len(content)} bytes")
```

Expand All @@ -225,24 +212,15 @@ http, pickle, threading, multiprocessing, ctypes, cffi
**Request (fails):**

```python
code = maker.create_tool(
'list_files',
'List files in directory',
{'path': 'str'},
{'files': 'list'}
)
code = maker.create_tool("list_files", "List files in directory", {"path": "str"}, {"files": "list"})
# ERROR: os import not allowed
```

**Request (succeeds):**

```python
code = maker.create_tool(
'extract_numbers',
'Extract all numbers from text',
{'text': 'str'},
{'numbers': 'list'},
max_attempts=3
"extract_numbers", "Extract all numbers from text", {"text": "str"}, {"numbers": "list"}, max_attempts=3
)
# Uses regex instead of os/file operations
```
Expand Down Expand Up @@ -287,23 +265,15 @@ The agent will:
maker = ToolMaker()

# Phone number validator
code = maker.create_tool(
'validate_phone',
'Validate US phone number format',
{'phone': 'str'},
{'is_valid': 'bool'}
)
code = maker.create_tool("validate_phone", "Validate US phone number format", {"phone": "str"}, {"is_valid": "bool"})
```

### Use Case 2: Text Processing

```python
# Extract hashtags from text
code = maker.create_tool(
'extract_hashtags',
'Extract all hashtags from social media text',
{'text': 'str'},
{'hashtags': 'list'}
"extract_hashtags", "Extract all hashtags from social media text", {"text": "str"}, {"hashtags": "list"}
)
```

Expand All @@ -312,23 +282,18 @@ code = maker.create_tool(
```python
# Calculate compound interest
code = maker.create_tool(
'compound_interest',
'Calculate compound interest',
{'principal': 'float', 'rate': 'float', 'years': 'float'},
{'amount': 'float'}
"compound_interest",
"Calculate compound interest",
{"principal": "float", "rate": "float", "years": "float"},
{"amount": "float"},
)
```

### Use Case 4: String Utilities

```python
# Generate slug from title
code = maker.create_tool(
'slugify',
'Convert title to URL-friendly slug',
{'title': 'str'},
{'slug': 'str'}
)
code = maker.create_tool("slugify", "Convert title to URL-friendly slug", {"title": "str"}, {"slug": "str"})
```

### Use Case 5: Static Sites
Expand All @@ -338,9 +303,9 @@ maker = WebsiteMaker()

# Documentation site
result = maker.create_website(
'api-docs',
['index.html', 'getting-started.html', 'reference.html', 'examples.html'],
'API documentation with navigation and code examples'
"api-docs",
["index.html", "getting-started.html", "reference.html", "examples.html"],
"API documentation with navigation and code examples",
)
```

Expand All @@ -365,10 +330,10 @@ result = maker.create_website(

```python
code = maker.create_tool(
'my_func',
'Does X',
{'input_value': 'str'}, # Exact name matters
{'output_result': 'str'}
"my_func",
"Does X",
{"input_value": "str"}, # Exact name matters
{"output_result": "str"},
)
```

Expand All @@ -391,9 +356,9 @@ code = maker.create_tool(

```python
result = maker.create_website(
'simple-site',
['index.html'], # Start with single page
'A simple single-page site'
"simple-site",
["index.html"], # Start with single page
"A simple single-page site",
)
```

Expand All @@ -406,21 +371,21 @@ from ai_projects.llm_maker.src.tool_maker import ToolMaker

maker = ToolMaker()
code = maker.create_tool(
'my_function',
'Does something',
{'input': 'str'},
{'output': 'str'},
max_attempts=5 # Increase retries
"my_function",
"Does something",
{"input": "str"},
{"output": "str"},
max_attempts=5, # Increase retries
)
```

### Batch Generation

```python
functions_to_generate = [
('add', 'Add two numbers', {'a': 'int', 'b': 'int'}, {'sum': 'int'}),
('multiply', 'Multiply numbers', {'a': 'int', 'b': 'int'}, {'product': 'int'}),
('divide', 'Divide two numbers', {'a': 'int', 'b': 'int'}, {'quotient': 'float'}),
("add", "Add two numbers", {"a": "int", "b": "int"}, {"sum": "int"}),
("multiply", "Multiply numbers", {"a": "int", "b": "int"}, {"product": "int"}),
("divide", "Divide two numbers", {"a": "int", "b": "int"}, {"quotient": "float"}),
]

maker = ToolMaker()
Expand Down
3 changes: 3 additions & 0 deletions .github/COPILOT_ADVANCED_CUSTOMIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ import json
import sys
from pathlib import Path


def analyze_codebase():
"""Analyze codebase structure"""
result = {
Expand All @@ -433,6 +434,7 @@ def analyze_codebase():
}
return result


def analyze_performance():
"""Analyze recent performance metrics"""
result = {
Expand All @@ -442,6 +444,7 @@ def analyze_performance():
}
return result


if __name__ == "__main__":
if len(sys.argv) > 1:
command = sys.argv[1]
Expand Down
2 changes: 2 additions & 0 deletions .github/MCP_SERVERS_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,14 @@ from mcp.types import Tool, TextContent

server = Server("my-server")


@server.call_tool()
async def call_tool(name: str, arguments: dict) -> TextContent:
if name == "hello":
return TextContent(text=f"Hello {arguments['name']}")
return TextContent(text="Unknown tool")


if __name__ == "__main__":
server.run()
```
Expand Down
1 change: 1 addition & 0 deletions .github/agents/AI_chat_development.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Chat conversation → data_out/self_learning/*.jsonl

```python
from shared.subscription_manager import get_subscription_manager, Feature

sub = mgr.get_subscription(user_id)
if not sub.has_feature(Feature.BASIC_CHAT):
return 403
Expand Down
8 changes: 4 additions & 4 deletions .github/agents/agi-reasoning.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ This agent works with the AGI provider system in this codebase:

```python
# Key classes (ai-projects/chat-cli/src/agi_provider.py)
AGIProvider # Wraps base LLM with reasoning capabilities
AGIContext # Memory: conversation_history, reasoning_chains, goals, learned_patterns
ReasoningStep # step_type, content, confidence, metadata
AGIProvider # Wraps base LLM with reasoning capabilities
AGIContext # Memory: conversation_history, reasoning_chains, goals, learned_patterns
ReasoningStep # step_type, content, confidence, metadata

# Factory
create_agi_provider(
Expand All @@ -148,7 +148,7 @@ create_agi_provider(
enable_self_reflection=True,
enable_task_decomposition=True,
reasoning_depth=3,
verbose=False
verbose=False,
)
```

Expand Down
3 changes: 2 additions & 1 deletion .github/agents/ai-architect.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class NewProvider(BaseChatProvider):
else:
return self.client.generate(messages)


# Wire into detection chain in shared/chat_providers.py
```

Expand Down Expand Up @@ -144,7 +145,7 @@ from shared.subscription_manager import get_subscription_manager, Feature
sub = mgr.get_subscription(user_id)
if not sub.has_feature(Feature.QUANTUM_COMPUTING):
return HttpResponse("Upgrade required", status_code=403)
if not sub.track_usage('quantum_jobs', amount=1):
if not sub.track_usage("quantum_jobs", amount=1):
return HttpResponse("Usage limit reached", status_code=429)
```

Expand Down
6 changes: 3 additions & 3 deletions .github/agents/aria-character.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ Aria uses `[aria:action:param]` tags embedded in text responses:

```python
stage_state = {
'aria': {'position': {'x': 15, 'y': 20}, 'expression': 'neutral', 'held_object': None, 'facing': 'right'},
'objects': {}, # Dynamic object registry
'environment': {'table': {...}, 'stage_bounds': {'width': 100, 'height': 100}}
"aria": {"position": {"x": 15, "y": 20}, "expression": "neutral", "held_object": None, "facing": "right"},
"objects": {}, # Dynamic object registry
"environment": {"table": {...}, "stage_bounds": {"width": 100, "height": 100}},
}
```

Expand Down
4 changes: 2 additions & 2 deletions .github/agents/platform-ops.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ ANALYTICS_DASHBOARD, BATCH_PROCESSING
sub = manager.get_subscription(user_id)
if not sub.has_feature(Feature.QUANTUM_COMPUTING):
return 403 # Upgrade required
if not sub.check_limit('quantum_jobs'):
if not sub.check_limit("quantum_jobs"):
return 429 # Usage limit reached
sub.increment_usage('quantum_jobs')
sub.increment_usage("quantum_jobs")
```

### Storage
Expand Down
15 changes: 5 additions & 10 deletions .github/agents/vision-ai.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,16 @@ Search order for `.pt` files:
Checkpoint format:

```python
{
'model_state_dict': state_dict,
'class_names': ['happy', 'sad', ...],
'epoch': int,
'accuracy': float
}
{"model_state_dict": state_dict, "class_names": ["happy", "sad", ...], "epoch": int, "accuracy": float}
```

### VisionInference API

```python
vi = VisionInference() # Auto-loads latest checkpoint
result = vi.predict(pil_image) # → {label, confidence, scores}
result = vi.predict_base64(b64_string) # → same
result = vi.predict_file(file_path) # → same
vi = VisionInference() # Auto-loads latest checkpoint
result = vi.predict(pil_image) # → {label, confidence, scores}
result = vi.predict_base64(b64_string) # → same
result = vi.predict_file(file_path) # → same
```

## Integration with Aria
Expand Down
Loading
Loading