From c199a0814f378559774c7ce7622961dab1ae3415 Mon Sep 17 00:00:00 2001 From: byKoma <132143848+byKoma@users.noreply.github.com> Date: Tue, 26 Aug 2025 22:33:19 +0200 Subject: [PATCH 1/2] Komas Changes --- .claude/settings.local.json | 9 +++ src/app/dashboard/docs/page.tsx | 79 +++++++++++++++++------- src/app/dashboard/examples/page.tsx | 45 ++++++++++++-- src/app/dashboard/playground/page.tsx | 89 ++++++++++++++++++++++++--- 4 files changed, 187 insertions(+), 35 deletions(-) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..cf512de --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,9 @@ +{ + "permissions": { + "allow": [ + "Bash(npm run build:*)" + ], + "deny": [], + "ask": [] + } +} \ No newline at end of file diff --git a/src/app/dashboard/docs/page.tsx b/src/app/dashboard/docs/page.tsx index 2568c78..8fa94b5 100644 --- a/src/app/dashboard/docs/page.tsx +++ b/src/app/dashboard/docs/page.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ 'use client'; import React from 'react'; @@ -6,16 +5,52 @@ import DashboardLayout from '@/app/components/layout/DashboardLayout'; import Card from '@/app/components/ui/Card'; import { Tab } from '@headlessui/react'; import { CodeBracketIcon, ChatBubbleLeftIcon, PhotoIcon, UserIcon } from '@heroicons/react/24/outline'; -/* eslint-disable @typescript-eslint/ban-ts-comment */ -// @ts-ignore import SyntaxHighlighter from 'react-syntax-highlighter'; -/* eslint-enable @typescript-eslint/ban-ts-comment */ +import { useTheme } from '@/app/providers/ThemeProvider'; function classNames(...classes: string[]) { return classes.filter(Boolean).join(' '); } export default function DocsPage() { + const { theme } = useTheme(); + + // Custom purple Matrix-style theme + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const purpleMatrixTheme: any = { + 'hljs': { + display: 'block', + overflowX: 'auto', + padding: '1rem', + background: theme === 'dark' ? '#0a0a0a' : '#f8f8ff', + color: '#9d4edd', + borderRadius: '0.5rem' + }, + 'hljs-keyword': { color: '#c77dff' }, + 'hljs-string': { color: '#e0aaff' }, + 'hljs-number': { color: '#7b2cbf' }, + 'hljs-comment': { color: '#6c63ff', fontStyle: 'italic' }, + 'hljs-function': { color: '#8b5cf6' }, + 'hljs-variable': { color: '#a855f7' }, + 'hljs-property': { color: '#9333ea' }, + 'hljs-built_in': { color: '#7c3aed' }, + 'hljs-title': { color: '#6d28d9' }, + 'hljs-literal': { color: '#8b5cf6' }, + 'hljs-type': { color: '#7c3aed' }, + 'hljs-attribute': { color: '#9333ea' }, + 'hljs-meta': { color: '#6c63ff' }, + 'hljs-tag': { color: '#8b5cf6' }, + 'hljs-name': { color: '#a855f7' }, + 'hljs-attr': { color: '#9333ea' }, + 'hljs-selector-id': { color: '#7c3aed' }, + 'hljs-selector-class': { color: '#8b5cf6' }, + 'hljs-regexp': { color: '#c77dff' }, + 'hljs-link': { color: '#e0aaff' }, + 'hljs-symbol': { color: '#7b2cbf' }, + 'hljs-bullet': { color: '#9d4edd' }, + 'hljs-addition': { color: '#8b5cf6', backgroundColor: theme === 'dark' ? '#1a1a1a' : '#faf5ff' }, + 'hljs-deletion': { color: '#7b2cbf', backgroundColor: theme === 'dark' ? '#1a1a1a' : '#faf5ff' } + }; const tabs = [ { name: 'Overview', @@ -35,7 +70,7 @@ export default function DocsPage() { The API uses bearer token authentication. Include your API key in the Authorization header of your requests:
-The API returns standard HTTP status codes and JSON error responses:
-OpenAI-compatible chat completions endpoint with enhanced features:
-Alternative endpoint supporting both single input and conversation format:
-Legacy endpoint for text generation, maintained for backward compatibility.
When stream: true, responses are sent as Server-Sent Events:
OpenAI-compatible image generation endpoint with enhanced parameters:
-Delete a generated image (only images you created):
-List all public characters (requires character_info permission):
Get detailed information about a specific character:
-Include the character_id parameter in text generation requests:
Create a new API key (requires authentication):
-Update API key permissions:
-Get detailed usage statistics:
-Setup usage-based billing for API access
The API is compatible with OpenAI SDKs. Simply change the base URL:
-