Skip to main content
Loading navigation
Back to prompt library

Qwen 2 for Skill Description and Vibe Coding Generation

Linked challenge: SkillProof Document Agent

Prompt source

implementation19 lines5 sectionsNo variables1 code block
Implement a Mastra AI tool that uses Qwen 2 to generate a detailed `descriptionGenerated` based on a user's `skill_description` and `experience_years`. Additionally, use Qwen 2 to generate a `vibeCodingAssessment` (e.g., 'Analytical', 'Collaborative') based on the skill. Show how this tool is called by your Mastra AI agent and updates the 'SkillProof' document in memory.

```typescript
import { createTool } from '@mastra-ai/core';
import { Qwen2 } from '@mastra-ai/llm-qwen2'; // Conceptual Qwen2 Mastra integration

const qwen2_llm = new Qwen2({ apiKey: 'YOUR_QWEN_API_KEY' });

const generateSkillContentTool = createTool({
  name: 'generateSkillContent',
  description: 'Generates a skill description and vibe coding assessment using Qwen 2.',
  input: { type: 'object', properties: { skillDescription: { type: 'string' }, experienceYears: { type: 'number' } } },
  output: { type: 'object', properties: { description: { type: 'string' }, vibeCoding: { type: 'string' } } },
  async handler({ skillDescription, experienceYears }) {
    const prompt = `Generate a detailed skill description for someone with ${experienceYears} years of experience in '${skillDescription}'. Also, provide 3-4 keywords for their 'vibe coding' based on this skill (e.g., 'Analytical, Problem-Solver').\nDescription: \nVibe Coding:`;
    // const response = await qwen2_llm.generate({ prompt });
    // Parse response into description and vibeCoding
    return { description: 'Generated description...', vibeCoding: 'Generated vibe codes...' };
  },
});

// Agent would call this tool and update its internal SkillProofDocument state.
```