-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_agent.bat
More file actions
100 lines (88 loc) · 2.53 KB
/
start_agent.bat
File metadata and controls
100 lines (88 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
title Recherche-Agent
echo ==============================================
echo Recherche-Agent
echo ==============================================
echo.
:start_menu
echo [1] Agent mit Standardparametern starten
echo [2] Agent mit eigenen Parametern starten
echo [3] Beenden
echo.
set /p choice="Ihre Wahl (1-3): "
if "%choice%"=="1" goto :standard_run
if "%choice%"=="2" goto :custom_run
if "%choice%"=="3" goto :end
echo Ungültige Eingabe. Bitte 1-3 wählen.
goto :start_menu
:standard_run
echo.
echo Starte Agent mit Standardparametern...
echo Kommando: npx tsx serper_agent.ts "KI Nachhaltigkeit" 3
echo.
echo Bitte warten - Agent wird gestartet...
echo.
call npx tsx serper_agent.ts "KI Nachhaltigkeit" 3
set AGENT_EXIT_CODE=%ERRORLEVEL%
echo.
echo ==============================================
if %AGENT_EXIT_CODE% neq 0 (
echo [FEHLER] Agent beendet mit Fehlercode: %AGENT_EXIT_CODE%
echo.
echo Mögliche Ursachen:
echo - TypeScript-Fehler in serper_agent.ts
echo - Fehlende npm-Pakete
echo.
echo LÖSUNGSVORSCHLÄGE:
echo 1. Führen Sie 'npm install' aus
) else (
echo [ERFOLG] Agent erfolgreich ausgeführt!
echo Überprüfen Sie den responses/ Ordner für Ergebnisse.
)
echo ==============================================
echo.
pause
goto :start_menu
:custom_run
echo.
set /p search_query="Geben Sie Ihre Suchanfrage ein: "
if "!search_query!"=="" set search_query=Aktuelle Forschung
set /p num_results="Anzahl der Ergebnisse (Standard 3): "
if "!num_results!"=="" set num_results=3
echo.
echo Starte Agent...
echo Kommando: npx tsx serper_agent.ts "!search_query!" !num_results!
echo.
echo Bitte warten - Agent wird gestartet...
echo.
REM Führe Kommando aus und fange Fehler ab
call npx tsx serper_agent.ts "!search_query!" !num_results!
set AGENT_EXIT_CODE=%ERRORLEVEL%
echo.
echo ==============================================
if %AGENT_EXIT_CODE% neq 0 (
echo [FEHLER] Agent beendet mit Fehlercode: %AGENT_EXIT_CODE%
echo.
echo Mögliche Ursachen:
echo - TypeScript-Fehler in serper_agent.ts
echo - Fehlende npm-Pakete
echo - Netzwerk-Probleme
echo.
echo LÖSUNGSVORSCHLÄGE:
echo 1. Führen Sie 'npm install' aus
echo 2. Prüfen Sie serper_agent.ts auf Syntaxfehler
) else (
echo [ERFOLG] Agent erfolgreich ausgeführt!
echo Überprüfen Sie den responses/ Ordner für Ergebnisse.
)
echo ==============================================
echo.
pause
goto :start_menu
:end
echo.
echo Auf Wiedersehen!
echo.
pause