|
56 | 56 | run: | |
57 | 57 | echo "TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }}" >> $GITHUB_ENV |
58 | 58 | export TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }} |
| 59 | + export GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }} |
59 | 60 | mkdir -p ${GITHUB_WORKSPACE}/typesense-data |
60 | 61 | cp ./search-server/typesense-server/Dockerfile ${GITHUB_WORKSPACE}/typesense-data/Dockerfile |
61 | 62 | cp ./search-server/typesense-scraper/typesense-scraper-config.json typesense-scraper-config.json |
|
65 | 66 | docker run -i --env-file typesense-scraper-updated.env -e "CONFIG=$(cat typesense-scraper-config.json | jq -r tostring)" typesense/docsearch-scraper |
66 | 67 | 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":["*"]}' |
67 | 68 |
|
| 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 | +
|
68 | 116 | - name: repository name fix and env |
69 | 117 | run: | |
70 | 118 | echo "letsencrypt_email=${{ secrets.LETSENCRYPT_EMAIL }}" >> $GITHUB_ENV |
|
0 commit comments