Spaces:
Sleeping
Sleeping
change: style on mahasiswa
Browse filesFiles changed (3)
19 unmodified lines2021222324232425262719 unmodified lines
$request = Http::baseUrl(rtrim($baseUrl, '/')) ->acceptJson() ->connectTimeout(5) ->timeout(20); ->connectTimeout(60) ->timeout(120);
if ($token !== null && $token !== '') { $request->withToken($token);2 unmodified lines345678928 unmodified lines383940404142434418 unmodified lines63646565666768697071717273747539 unmodified lines11511611711711811912012116 unmodified lines13813914014014114214314453 unmodified lines1981992002002012022032042052062072072082092102112 unmodified linesnamespace App\Http\Controllers;
use App\Exceptions\RagApiException;use Illuminate\Http\Client\ConnectionException;use Illuminate\Http\JsonResponse;use Illuminate\Http\RedirectResponse;use Illuminate\Http\Request;28 unmodified lines
try { $session = $this->createChatSession($payload, $this->authToken($request)); } catch (RagApiException $exception) { } catch (RagApiException|ConnectionException $exception) { return back() ->withErrors(['chat' => $exception->getMessage()]) ->withInput();18 unmodified lines
try { $currentSession = $this->getChatSession($sessionId, $token); } catch (RagApiException $exception) { } catch (RagApiException|ConnectionException $exception) { $backendMessage ??= $exception->getMessage() ?: null; }
try { $messages = $this->getChatHistory($sessionId, $token)['data']; } catch (RagApiException $exception) { } catch (RagApiException|ConnectionException $exception) { $backendMessage ??= $exception->getMessage() ?: null; }
39 unmodified lines $payload['content'], $this->authToken($request), ); } catch (RagApiException $exception) { } catch (RagApiException|ConnectionException $exception) { if ($request->expectsJson() || $request->accepts('text/event-stream')) { return response()->json([ 'errors' => [16 unmodified lines $payload['content'], $this->authToken($request), ); } catch (RagApiException $exception) { } catch (RagApiException|ConnectionException $exception) { if ($request->expectsJson()) { return response()->json([ 'errors' => [53 unmodified lines
try { $courses = $this->listCourses(limit: 100, token: $token)['data']; } catch (RagApiException $exception) { } catch (RagApiException|ConnectionException $exception) { $backendMessage = $exception->getMessage() ?: null; }
if ($token !== null) { try { $chatSessions = $this->listChatSessions(limit: 20, token: $token)['data']; } catch (RagApiException $exception) { } catch (RagApiException|ConnectionException $exception) { $backendMessage ??= $exception->getMessage() ?: null; } }1062 unmodified lines106310641065106610671068106910701071107210671068106910731074107510761062 unmodified lines }
setQuestion(content); const errorMessage = error instanceof Error ? error.message : ''; const isGenericError = !errorMessage || errorMessage === 'Internal Server Error' || errorMessage === 'Server Error'; setLocalBackendMessage( error instanceof Error && error.message ? error.message : undefined, isGenericError ? undefined : errorMessage, ); } finally { const emptyStreamingMessage =app/Http/Controllers/Controller.php+2-2
app/Http/Controllers/MahasiswaController.php+8-7
resources/js/pages/mahasiswa-chat.tsx+7-3