mirror of
https://github.com/agentuniverse-ai/agentUniverse.git
synced 2026-02-09 01:59:19 +08:00
refactor: mv prompt_generator_app to third_party_examples
This commit is contained in:
7
examples/third_party_examples/apps/__init__.py
Normal file
7
examples/third_party_examples/apps/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# !/usr/bin/env python3
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
# @Time : 2025/10/30 20:59
|
||||
# @Author : jerry.zzw
|
||||
# @Email : jerry.zzw@antgroup.com
|
||||
# @FileName: __init__.py.py
|
||||
@@ -0,0 +1,7 @@
|
||||
# !/usr/bin/env python3
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
# @Time : 2025/10/30 20:59
|
||||
# @Author : jerry.zzw
|
||||
# @Email : jerry.zzw@antgroup.com
|
||||
# @FileName: __init__.py.py
|
||||
@@ -7,7 +7,7 @@
|
||||
# @FileName: prompt_service.py
|
||||
"""Prompt Generation Service.
|
||||
|
||||
Provides core prompt generation service functionality for prompt_generator_app.
|
||||
Provides core prompt generation service functionality for app.
|
||||
This service layer encapsulates the core logic for prompt generation, optimization,
|
||||
and configuration management.
|
||||
"""
|
||||
@@ -22,7 +22,7 @@ project_root = Path(__file__).parent.parent.parent.parent.parent.parent
|
||||
if str(project_root) not in sys.path:
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import (
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import (
|
||||
PromptTemplateHelper,
|
||||
generate_prompt_config,
|
||||
optimize_existing_prompt
|
||||
@@ -7,20 +7,19 @@
|
||||
# @FileName: template_service.py
|
||||
"""Prompt Template Service.
|
||||
|
||||
Provides template management and generation functionality for prompt_generator_app.
|
||||
Provides template management and generation functionality for app.
|
||||
This service layer focuses on template storage, retrieval, and management.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Optional, Any
|
||||
from typing import Dict, List, Any
|
||||
|
||||
# Add project root directory to Python path
|
||||
project_root = Path(__file__).parent.parent.parent.parent.parent.parent
|
||||
if str(project_root) not in sys.path:
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import PromptTemplateHelper
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import PromptTemplateHelper
|
||||
|
||||
|
||||
class PromptTemplateService:
|
||||
@@ -10,7 +10,6 @@
|
||||
This demo script shows how to use the prompt generator to create different types of agent prompts.
|
||||
Suitable for learning and understanding how to use the prompt generator.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -19,7 +18,7 @@ project_root = Path(__file__).parent.parent.parent.parent.parent.parent
|
||||
if str(project_root) not in sys.path:
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import (
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import (
|
||||
PromptTemplateHelper,
|
||||
generate_prompt_config
|
||||
)
|
||||
@@ -7,7 +7,6 @@
|
||||
# @FileName: prompt_optimizer_demo.py
|
||||
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Add project root to Python path
|
||||
@@ -15,7 +14,7 @@ project_root = Path(__file__).parent.parent.parent.parent.parent
|
||||
if str(project_root) not in sys.path:
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import optimize_existing_prompt
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import optimize_existing_prompt
|
||||
|
||||
|
||||
def demo_basic_prompt_optimization():
|
||||
@@ -21,11 +21,10 @@ project_root = Path(__file__).parent.parent.parent.parent.parent.parent
|
||||
if str(project_root) not in sys.path:
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import (
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import (
|
||||
generate_prompt_config,
|
||||
optimize_existing_prompt,
|
||||
PromptTemplateHelper,
|
||||
PromptGenerationError,
|
||||
UnsupportedAgentTypeError
|
||||
)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
import unittest
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Add project root to Python path
|
||||
@@ -16,11 +15,8 @@ project_root = Path(__file__).parent.parent.parent.parent.parent
|
||||
if str(project_root) not in sys.path:
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import (
|
||||
optimize_existing_prompt,
|
||||
_analyze_existing_prompt,
|
||||
_generate_improvement_suggestions,
|
||||
_apply_optimizations
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import (
|
||||
optimize_existing_prompt
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# @FileName: prompt_util.py
|
||||
"""Prompt Utility Functions.
|
||||
|
||||
Provides practical utility functions for prompt processing in prompt_generator_app.
|
||||
Provides practical utility functions for prompt processing in app.
|
||||
This utility module focuses on prompt content analysis, validation, and transformation.
|
||||
"""
|
||||
import re
|
||||
@@ -7,7 +7,7 @@
|
||||
# @FileName: yaml_util.py
|
||||
"""YAML Utility Functions.
|
||||
|
||||
Provides YAML file reading, writing, and validation functionality for prompt_generator_app.
|
||||
Provides YAML file reading, writing, and validation functionality for app.
|
||||
This utility module focuses on YAML data processing and validation.
|
||||
"""
|
||||
import os
|
||||
@@ -0,0 +1,7 @@
|
||||
# !/usr/bin/env python3
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
# @Time : 2025/10/30 20:59
|
||||
# @Author : jerry.zzw
|
||||
# @Email : jerry.zzw@antgroup.com
|
||||
# @FileName: __init__.py.py
|
||||
@@ -14,7 +14,6 @@ provides flexible configuration options.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -23,7 +22,7 @@ current_dir = Path(__file__).parent
|
||||
project_root = current_dir.parent
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import (
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import (
|
||||
PromptTemplateHelper,
|
||||
generate_prompt_config
|
||||
)
|
||||
@@ -17,7 +17,7 @@ import os
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from agentuniverse.prompt.prompt_generator_helper import (
|
||||
from examples.third_party_examples.apps.prompt_generator_app.prompt_generator_helper import (
|
||||
PromptTemplateHelper,
|
||||
generate_prompt_config,
|
||||
optimize_existing_prompt
|
||||
@@ -1,7 +0,0 @@
|
||||
# !/usr/bin/env python3
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
# @Time : 2025/09/16 23:00
|
||||
# @Author : Libres-coder
|
||||
# @Email : liudi1366@gmail.com
|
||||
# @FileName: __init__.py
|
||||
Reference in New Issue
Block a user