-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (64 loc) · 2.25 KB
/
setup-search-index.yml
File metadata and controls
68 lines (64 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Setup Search Index
on:
workflow_run:
workflows: ["Build Search Index"]
types:
- completed
workflow_dispatch:
jobs:
init-conversation-store:
runs-on: ubuntu-latest
steps:
- name: Create conversation store collection
env:
TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
run: |
curl 'https://search.docs.servicestack.net/collections' \
-X POST \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"name": "conversation_store",
"fields": [
{
"name": "conversation_id",
"type": "string"
},
{
"name": "model_id",
"type": "string"
},
{
"name": "timestamp",
"type": "int32"
},
{
"name": "role",
"type": "string",
"index": false
},
{
"name": "message",
"type": "string",
"index": false
}
]
}'
- name: Create or update conversation model
env:
TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
run: |
curl 'https://search.docs.servicestack.net/conversations/models' \
-X POST \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"id": "conv-model-1",
"model_name": "google/gemini-flash-latest",
"history_collection": "conversation_store",
"api_key": "'"${GOOGLE_API_KEY}"'",
"system_prompt": "You are an intelligent assistant for question-answering about ServiceStack Software. Try to answer questions using the provided context. If a response has no references in the provided context, politely say you do not have knowledge about that topic.",
"max_bytes": 16384
}'