Skip to content

Commit 05250ab

Browse files
committed
Create conversation_store and conv-model-1 conversation model when building the search index
1 parent 511d962 commit 05250ab

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/search-index-update.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
run: |
5757
echo "TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }}" >> $GITHUB_ENV
5858
export TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }}
59+
export GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}
5960
mkdir -p ${GITHUB_WORKSPACE}/typesense-data
6061
cp ./search-server/typesense-server/Dockerfile ${GITHUB_WORKSPACE}/typesense-data/Dockerfile
6162
cp ./search-server/typesense-scraper/typesense-scraper-config.json typesense-scraper-config.json
@@ -65,6 +66,53 @@ jobs:
6566
docker run -i --env-file typesense-scraper-updated.env -e "CONFIG=$(cat typesense-scraper-config.json | jq -r tostring)" typesense/docsearch-scraper
6667
curl 'http://172.17.0.2:8108/keys' -X POST -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -H 'Content-Type: application/json' -d '{"value": "N4N8bF0XwyvzwCGwm3CKB0QcnwyWtygo","description": "Search only","actions": ["documents:search"],"collections":["*"]}'
6768
69+
# Create conversation store collection
70+
curl 'http://172.17.0.2:8108/collections' \
71+
-X POST \
72+
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
73+
-H 'Content-Type: application/json' \
74+
-d '{
75+
"name": "conversation_store",
76+
"fields": [
77+
{
78+
"name": "conversation_id",
79+
"type": "string"
80+
},
81+
{
82+
"name": "model_id",
83+
"type": "string"
84+
},
85+
{
86+
"name": "timestamp",
87+
"type": "int32"
88+
},
89+
{
90+
"name": "role",
91+
"type": "string",
92+
"index": false
93+
},
94+
{
95+
"name": "message",
96+
"type": "string",
97+
"index": false
98+
}
99+
]
100+
}'
101+
102+
# Create or update conversation model
103+
curl 'http://172.17.0.2:8108/conversations/models' \
104+
-X POST \
105+
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
106+
-H 'Content-Type: application/json' \
107+
-d '{
108+
"id": "conv-model-1",
109+
"model_name": "google/gemini-flash-latest",
110+
"history_collection": "conversation_store",
111+
"api_key": "'"${GOOGLE_API_KEY}"'",
112+
"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.",
113+
"max_bytes": 16384
114+
}'
115+
68116
- name: repository name fix and env
69117
run: |
70118
echo "letsencrypt_email=${{ secrets.LETSENCRYPT_EMAIL }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)