66use Cortex \Agents \Agent ;
77use Cortex \JsonSchema \Schema ;
88use Illuminate \Support \ServiceProvider ;
9+ use Cortex \ModelInfo \Enums \ModelFeature ;
910use Cortex \LLM \Data \Messages \UserMessage ;
1011use Cortex \LLM \Data \Messages \SystemMessage ;
1112
13+ use function Orchestra \Testbench \package_path ;
14+
1215class CortexServiceProvider extends ServiceProvider
1316{
1417 /**
@@ -24,10 +27,15 @@ public function register(): void
2427 */
2528 public function boot (): void
2629 {
30+ config ()->set (
31+ 'cortex.prompt_factory.blade.path ' ,
32+ package_path ('workbench/resources/views/prompts ' ),
33+ );
34+
2735 Cortex::registerAgent (new Agent (
2836 name: 'holiday_generator ' ,
2937 prompt: 'Invent a new holiday and describe its traditions. Max 3 sentences. ' ,
30- llm: Cortex::llm ('openai ' , ' gpt-4o-mini ' )->withTemperature (1.5 ),
38+ llm: Cortex::llm ('ollama/ gpt-oss:20b ' )->withTemperature (1.5 ),
3139 output: [
3240 Schema::string ('name ' )->required (),
3341 Schema::string ('description ' )->required (),
@@ -55,8 +63,11 @@ public function boot(): void
5563 new UserMessage ('Tell me a joke about {topic}. ' ),
5664 ])
5765 ->metadata (
58- provider: 'ollama ' ,
59- model: 'phi4 ' ,
66+ provider: 'lmstudio ' ,
67+ model: 'gpt-oss:20b ' ,
68+ parameters: [
69+ 'temperature ' => 1.5 ,
70+ ],
6071 structuredOutput: Schema::object ()->properties (
6172 Schema::string ('setup ' )->required (),
6273 Schema::string ('punchline ' )->required (),
@@ -79,8 +90,15 @@ public function boot(): void
7990 Cortex::registerAgent (new Agent (
8091 name: 'generic ' ,
8192 prompt: 'You are a helpful assistant. ' ,
82- // llm: 'ollama/gpt-oss:20b',
8393 llm: 'lmstudio/openai/gpt-oss-20b '
8494 ));
95+
96+ Cortex::registerAgent (new Agent (
97+ name: 'code_generator ' ,
98+ prompt: Cortex::prompt ()->factory ('blade ' )->make ('example ' , [
99+ 'name ' => 'Alice ' ,
100+ 'language ' => 'Python ' ,
101+ ]),
102+ ));
85103 }
86104}
0 commit comments