diff --git a/harper-best-practices/SKILL.md b/harper-best-practices/SKILL.md index 85d4c37..4c1be3d 100644 --- a/harper-best-practices/SKILL.md +++ b/harper-best-practices/SKILL.md @@ -5,7 +5,7 @@ description: automatic APIs, authentication, custom resources, and data handling. Triggers on tasks involving Harper database design, API implementation, and deployment. -license: MIT +license: Apache-2.0 metadata: author: harper version: '1.0.0' diff --git a/harper-best-practices/rules/checking-authentication.md b/harper-best-practices/rules/checking-authentication.md index d50688f..fafd213 100644 --- a/harper-best-practices/rules/checking-authentication.md +++ b/harper-best-practices/rules/checking-authentication.md @@ -77,8 +77,7 @@ This project includes two Resource patterns for that flow: - with an existing Authorization token (either Basic Auth or a JWT) and you want to issue new tokens, or - from an explicit `{ username, password }` payload (useful for direct “login” from a CLI/mobile client). -``` -js +```js export class IssueTokens extends Resource { static loadAsInstance = false; @@ -119,8 +118,7 @@ static loadAsInstance = false; **Description / use case:** When the JWT expires, the client uses the refresh token to get a new JWT without re-supplying username/password. -``` -js +```js export class RefreshJWT extends Resource { static loadAsInstance = false; diff --git a/harper-best-practices/rules/vector-indexing.md b/harper-best-practices/rules/vector-indexing.md index 00717cf..197093e 100644 --- a/harper-best-practices/rules/vector-indexing.md +++ b/harper-best-practices/rules/vector-indexing.md @@ -45,6 +45,7 @@ Use this skill when you need to perform similarity searches on high-dimensional ``` 5. **Generate Embeddings**: Use external services (OpenAI, Ollama) to generate the numeric vectors before storing or searching them in Harper. +```typescript const { Product } = tables; import OpenAI from 'openai'; @@ -120,16 +121,17 @@ generateEmbedding = process.env.EMBEDDING_GENERATOR === 'ollama' } -```` +``` + Sample request to the `ProductSearch` resource which prompts to find "shorts for the gym": ```bash curl -X POST "http://localhost:9926/ProductSearch/" \ --H "accept: \ +-H "accept: application/json \ -H "Content-Type: application/json" \ -H "Authorization: Basic " \ -d '{"prompt": "shorts for the gym"}' -```` +``` ---