rm spec ab stuff
Browse files
src/lib/components/PicletGenerator/PicletGenerator.svelte
CHANGED
@@ -70,58 +70,6 @@
|
|
70 |
// Use HunyuanTurbos client only
|
71 |
const hunyuanResult = await client.predict("/chat", [prompt]);
|
72 |
return hunyuanResult.data[0] || '';
|
73 |
-
|
74 |
-
// Unused client handling (kept for future use)
|
75 |
-
// switch (currentTextClient) {
|
76 |
-
// case 'hunyuan':
|
77 |
-
// // HunyuanTurbos client (assuming similar API to other simple clients)
|
78 |
-
// const hunyuanResult = await client.predict("/chat", [prompt]);
|
79 |
-
// return hunyuanResult.data[0] || '';
|
80 |
-
//
|
81 |
-
// case 'command':
|
82 |
-
// case 'dots':
|
83 |
-
// // Command and dots clients use direct predict call (assuming similar to zephyr)
|
84 |
-
// const result = await client.predict("/chat", [prompt]);
|
85 |
-
// return result.data[0] || '';
|
86 |
-
//
|
87 |
-
// case 'zephyr':
|
88 |
-
// // Zephyr client uses direct predict call
|
89 |
-
// const zephyrResult = await client.predict("/chat", [prompt]);
|
90 |
-
// return zephyrResult.data[0] || '';
|
91 |
-
//
|
92 |
-
// case 'qwen':
|
93 |
-
// // Qwen client uses the complex API with settings and workflowState
|
94 |
-
// const defaultSettings = {
|
95 |
-
// "system_prompt": "",
|
96 |
-
// "max_new_tokens": 2048,
|
97 |
-
// "temperature": 0.7,
|
98 |
-
// "top_p": 0.9,
|
99 |
-
// "top_k": 50,
|
100 |
-
// "repetition_penalty": 1.05
|
101 |
-
// };
|
102 |
-
//
|
103 |
-
// const defaultState = {
|
104 |
-
// "messages": [],
|
105 |
-
// "system": "",
|
106 |
-
// "tools": null
|
107 |
-
// };
|
108 |
-
//
|
109 |
-
// const thinkingBtnState = {
|
110 |
-
// "enable_thinking": true
|
111 |
-
// };
|
112 |
-
//
|
113 |
-
// const output = await withQwenTimeout(() => client.predict(13, [
|
114 |
-
// prompt,
|
115 |
-
// defaultSettings,
|
116 |
-
// thinkingBtnState,
|
117 |
-
// defaultState
|
118 |
-
// ]));
|
119 |
-
//
|
120 |
-
// return output.data[0] || '';
|
121 |
-
//
|
122 |
-
// default:
|
123 |
-
// throw new Error(`Unsupported text client: ${currentTextClient}`);
|
124 |
-
// }
|
125 |
};
|
126 |
|
127 |
let workflowState: PicletWorkflowState = $state({
|
@@ -393,25 +341,6 @@ Format your response exactly as follows:
|
|
393 |
{Detailed physical description showing how the object becomes a creature. Ensure the creature uses all the unique attributes of the object. Include colors, shapes, materials, eyes, limbs, mouth, and distinctive features. This section should be comprehensive as it will be used for both stats generation and image creation.}`;
|
394 |
|
395 |
try {
|
396 |
-
// Create the required workflowState structure based on qwen.html
|
397 |
-
const defaultState = {
|
398 |
-
"conversation_contexts": {},
|
399 |
-
"conversations": [],
|
400 |
-
"conversation_id": "",
|
401 |
-
};
|
402 |
-
|
403 |
-
// Create default settings based on qwen.html with minimal thinking tokens
|
404 |
-
const defaultSettings = {
|
405 |
-
"model": "qwen3-235b-a22b",
|
406 |
-
"sys_prompt": "You are a creative monster designer specializing in transforming everyday objects into imaginative Pokémon-style creatures. Follow the exact format provided and create detailed, engaging descriptions that bring these monsters to life.",
|
407 |
-
"thinking_budget": 1
|
408 |
-
};
|
409 |
-
|
410 |
-
// Create thinking button workflowState
|
411 |
-
const thinkingBtnState = {
|
412 |
-
"enable_thinking": true
|
413 |
-
};
|
414 |
-
|
415 |
const responseText = await generateText(conceptPrompt);
|
416 |
|
417 |
if (!responseText || responseText.trim() === '') {
|
@@ -453,25 +382,6 @@ ${workflowState.picletConcept}
|
|
453 |
Create a concise visual description (1-3 sentences, max 100 words). Focus only on colors, shapes, materials, eyes, limbs, mouth, and distinctive features. Omit all non-visual information like abilities and backstory.`;
|
454 |
|
455 |
try {
|
456 |
-
// Create the required workflowState structure based on qwen.html
|
457 |
-
const defaultState = {
|
458 |
-
"conversation_contexts": {},
|
459 |
-
"conversations": [],
|
460 |
-
"conversation_id": "",
|
461 |
-
};
|
462 |
-
|
463 |
-
// Create default settings based on qwen.html with minimal thinking tokens
|
464 |
-
const defaultSettings = {
|
465 |
-
"model": "qwen3-235b-a22b",
|
466 |
-
"sys_prompt": "You are an expert at creating concise visual descriptions for image generation. Extract ONLY visual appearance details and describe them in 1-2 sentences (max 50 words). Focus on colors, shape, eyes, limbs, and distinctive features. Omit all non-visual information like abilities, personality, or backstory.",
|
467 |
-
"thinking_budget": 1
|
468 |
-
};
|
469 |
-
|
470 |
-
// Create thinking button workflowState
|
471 |
-
const thinkingBtnState = {
|
472 |
-
"enable_thinking": true
|
473 |
-
};
|
474 |
-
|
475 |
const responseText = await generateText(imagePromptPrompt);
|
476 |
|
477 |
if (!responseText || responseText.trim() === '') {
|
@@ -689,7 +599,6 @@ The output should be formatted as a JSON instance that conforms to the schema be
|
|
689 |
"type": "object",
|
690 |
"properties": {
|
691 |
"name": {"type": "string", "description": "Name of the special ability"},
|
692 |
-
"description": {"type": "string", "description": "Description of what the ability does"},
|
693 |
"triggers": {
|
694 |
"type": "array",
|
695 |
"items": {"$ref": "#/definitions/Trigger"},
|
@@ -698,7 +607,7 @@ The output should be formatted as a JSON instance that conforms to the schema be
|
|
698 |
"description": "Single trigger effect for the special ability"
|
699 |
}
|
700 |
},
|
701 |
-
"required": ["name"
|
702 |
"additionalProperties": false
|
703 |
},
|
704 |
"movepool": {
|
@@ -777,28 +686,9 @@ Base the tier and stats on the object rarity:
|
|
777 |
|
778 |
Write your response within \`\`\`json\`\`\``;
|
779 |
|
780 |
-
console.log('Generating monster stats
|
781 |
|
782 |
try {
|
783 |
-
// Create the required workflowState structure based on qwen.html
|
784 |
-
const defaultState = {
|
785 |
-
"conversation_contexts": {},
|
786 |
-
"conversations": [],
|
787 |
-
"conversation_id": "",
|
788 |
-
};
|
789 |
-
|
790 |
-
// Create default settings based on qwen.html with minimal thinking tokens
|
791 |
-
const defaultSettings = {
|
792 |
-
"model": "qwen3-235b-a22b",
|
793 |
-
"sys_prompt": "You are a game designer specializing in monster stats and abilities. You must ONLY output valid JSON that matches the provided schema exactly. Do not include any text before or after the JSON. Do not include null values in your JSON response. Your entire response should be wrapped in a ```json``` code block.",
|
794 |
-
"thinking_budget": 1
|
795 |
-
};
|
796 |
-
|
797 |
-
// Create thinking button workflowState
|
798 |
-
const thinkingBtnState = {
|
799 |
-
"enable_thinking": true
|
800 |
-
};
|
801 |
-
|
802 |
const responseText = await generateText(statsPrompt);
|
803 |
|
804 |
if (!responseText || responseText.trim() === '') {
|
|
|
70 |
// Use HunyuanTurbos client only
|
71 |
const hunyuanResult = await client.predict("/chat", [prompt]);
|
72 |
return hunyuanResult.data[0] || '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
};
|
74 |
|
75 |
let workflowState: PicletWorkflowState = $state({
|
|
|
341 |
{Detailed physical description showing how the object becomes a creature. Ensure the creature uses all the unique attributes of the object. Include colors, shapes, materials, eyes, limbs, mouth, and distinctive features. This section should be comprehensive as it will be used for both stats generation and image creation.}`;
|
342 |
|
343 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
const responseText = await generateText(conceptPrompt);
|
345 |
|
346 |
if (!responseText || responseText.trim() === '') {
|
|
|
382 |
Create a concise visual description (1-3 sentences, max 100 words). Focus only on colors, shapes, materials, eyes, limbs, mouth, and distinctive features. Omit all non-visual information like abilities and backstory.`;
|
383 |
|
384 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
const responseText = await generateText(imagePromptPrompt);
|
386 |
|
387 |
if (!responseText || responseText.trim() === '') {
|
|
|
599 |
"type": "object",
|
600 |
"properties": {
|
601 |
"name": {"type": "string", "description": "Name of the special ability"},
|
|
|
602 |
"triggers": {
|
603 |
"type": "array",
|
604 |
"items": {"$ref": "#/definitions/Trigger"},
|
|
|
607 |
"description": "Single trigger effect for the special ability"
|
608 |
}
|
609 |
},
|
610 |
+
"required": ["name"],
|
611 |
"additionalProperties": false
|
612 |
},
|
613 |
"movepool": {
|
|
|
686 |
|
687 |
Write your response within \`\`\`json\`\`\``;
|
688 |
|
689 |
+
console.log('Generating monster stats');
|
690 |
|
691 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
692 |
const responseText = await generateText(statsPrompt);
|
693 |
|
694 |
if (!responseText || responseText.trim() === '') {
|
src/lib/db/piclets.ts
CHANGED
@@ -75,7 +75,7 @@ export async function generatedDataToPicletInstance(data: GeneratedPicletData, l
|
|
75 |
// Convert from PicletStats.SpecialAbility to battle-engine.SpecialAbility
|
76 |
const convertedSpecialAbility = {
|
77 |
name: stats.specialAbility.name,
|
78 |
-
description: stats.
|
79 |
effects: stats.specialAbility.effects as any,
|
80 |
triggers: stats.specialAbility.triggers as any
|
81 |
};
|
|
|
75 |
// Convert from PicletStats.SpecialAbility to battle-engine.SpecialAbility
|
76 |
const convertedSpecialAbility = {
|
77 |
name: stats.specialAbility.name,
|
78 |
+
description: `Special ability of ${stats.name}`, // Generate a generic description since it's removed from stats
|
79 |
effects: stats.specialAbility.effects as any,
|
80 |
triggers: stats.specialAbility.triggers as any
|
81 |
};
|
src/lib/types/index.ts
CHANGED
@@ -162,7 +162,6 @@ export interface PicletStats {
|
|
162 |
nature: Nature;
|
163 |
specialAbility: {
|
164 |
name: string;
|
165 |
-
description: string;
|
166 |
effects?: BattleEffect[];
|
167 |
triggers?: AbilityTrigger[];
|
168 |
};
|
|
|
162 |
nature: Nature;
|
163 |
specialAbility: {
|
164 |
name: string;
|
|
|
165 |
effects?: BattleEffect[];
|
166 |
triggers?: AbilityTrigger[];
|
167 |
};
|
src/lib/utils/battleConversion.ts
CHANGED
@@ -129,7 +129,10 @@ export function picletStatsToBattleDefinition(stats: PicletStats, name: string,
|
|
129 |
secondaryType: stats.secondaryType as PicletType || undefined,
|
130 |
baseStats: stats.baseStats,
|
131 |
nature: stats.nature,
|
132 |
-
specialAbility:
|
|
|
|
|
|
|
133 |
movepool: stats.movepool as any
|
134 |
};
|
135 |
}
|
|
|
129 |
secondaryType: stats.secondaryType as PicletType || undefined,
|
130 |
baseStats: stats.baseStats,
|
131 |
nature: stats.nature,
|
132 |
+
specialAbility: {
|
133 |
+
...stats.specialAbility,
|
134 |
+
description: `Special ability of ${stats.name || name}` // Add description since it's removed from generation
|
135 |
+
} as any,
|
136 |
movepool: stats.movepool as any
|
137 |
};
|
138 |
}
|