@harperfast/template-react-studio 1.5.7 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -77,8 +77,7 @@ This project includes two Resource patterns for that flow:
|
|
|
77
77
|
- with an existing Authorization token (either Basic Auth or a JWT) and you want to issue new tokens, or
|
|
78
78
|
- from an explicit `{ username, password }` payload (useful for direct “login” from a CLI/mobile client).
|
|
79
79
|
|
|
80
|
-
```
|
|
81
|
-
js
|
|
80
|
+
```js
|
|
82
81
|
export class IssueTokens extends Resource {
|
|
83
82
|
static loadAsInstance = false;
|
|
84
83
|
|
|
@@ -119,8 +118,7 @@ static loadAsInstance = false;
|
|
|
119
118
|
|
|
120
119
|
**Description / use case:** When the JWT expires, the client uses the refresh token to get a new JWT without re-supplying username/password.
|
|
121
120
|
|
|
122
|
-
```
|
|
123
|
-
js
|
|
121
|
+
```js
|
|
124
122
|
export class RefreshJWT extends Resource {
|
|
125
123
|
static loadAsInstance = false;
|
|
126
124
|
|
|
@@ -45,6 +45,7 @@ Use this skill when you need to perform similarity searches on high-dimensional
|
|
|
45
45
|
```
|
|
46
46
|
5. **Generate Embeddings**: Use external services (OpenAI, Ollama) to generate the numeric vectors before storing or searching them in Harper.
|
|
47
47
|
|
|
48
|
+
```typescript
|
|
48
49
|
const { Product } = tables;
|
|
49
50
|
|
|
50
51
|
import OpenAI from 'openai';
|
|
@@ -120,16 +121,17 @@ generateEmbedding = process.env.EMBEDDING_GENERATOR === 'ollama'
|
|
|
120
121
|
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
```
|
|
125
|
+
|
|
124
126
|
Sample request to the `ProductSearch` resource which prompts to find "shorts for the gym":
|
|
125
127
|
|
|
126
128
|
```bash
|
|
127
129
|
curl -X POST "http://localhost:9926/ProductSearch/" \
|
|
128
|
-
-H "accept: \
|
|
130
|
+
-H "accept: application/json \
|
|
129
131
|
-H "Content-Type: application/json" \
|
|
130
132
|
-H "Authorization: Basic <YOUR_AUTH>" \
|
|
131
133
|
-d '{"prompt": "shorts for the gym"}'
|
|
132
|
-
|
|
134
|
+
```
|
|
133
135
|
|
|
134
136
|
---
|
|
135
137
|
|
package/package.json
CHANGED
package/skills-lock.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"harper-best-practices": {
|
|
5
5
|
"source": "harperfast/skills",
|
|
6
6
|
"sourceType": "github",
|
|
7
|
-
"computedHash": "
|
|
7
|
+
"computedHash": "5ca1d54b835715cbf0829f1ad182dc3149bfb943f0b46f7a59b2998540f1c7a4"
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|