Skip to content

Commit

Permalink
Merge pull request #8 from dataesr/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
folland87 authored Mar 26, 2024
2 parents d851c82 + 154d660 commit 6bad6f7
Show file tree
Hide file tree
Showing 9 changed files with 229 additions and 226 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/main.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build and deploy production

on:
workflow_run:
workflows: ["Bump"]
types:
- completed
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

env:
DEPLOYMENT: scanr-next-gen
Expand All @@ -14,6 +13,7 @@ env:

jobs:
publish-ghcr:
name: 📦 Publish Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
docker push --all-tags $IMAGE_ID
release:
name: Create new Github release
name: 🚀 Create release
runs-on: ubuntu-latest
needs: publish-ghcr
steps:
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "client",
"private": true,
"version": "0.0.9",
"version": "0.0.7",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
1 change: 0 additions & 1 deletion client/src/api/networks/network/communities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default async function communitiesCreate(graph: Graph, computeClusters: b
const communities = Promise.all(
Array.from({ length: count }, async (_, index) => {
const hits = await networkSearchHits(query, model, communityGetLinks(graph, index))
console.log("trois")

const community = {
index: index,
Expand Down
17 changes: 14 additions & 3 deletions client/src/api/networks/network/openai.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import MistralClient, { ResponseFormats } from "@mistralai/mistralai"

const ENABLED = false
const { VITE_MISTRAL_API_KEY } = import.meta.env
const mistral = new MistralClient(VITE_MISTRAL_API_KEY)

async function mistralLabelsFromDomains(domains: any): Promise<string> {
const { VITE_MISTRAL_API_KEY } = import.meta.env

if (!VITE_MISTRAL_API_KEY) {
throw new Error("Mistral error: bad api key")
}

const mistral = new MistralClient(VITE_MISTRAL_API_KEY)
const completion = await mistral.chat({
messages: [
{
Expand Down Expand Up @@ -50,8 +55,14 @@ export async function openAiLabeledClusters(clusters: Array<any>) {

if (!domains) return clusters

const mistral_labels = await mistralLabelsFromDomains(domains).then((response) => JSON.parse(response))
const mistral_labels = await mistralLabelsFromDomains(domains).then(
(response) => JSON.parse(response),
(err) => console.log(err)
)
console.log("mistral_labels", mistral_labels)
if (!mistral_labels || mistral_labels.constructor != Object) {
return clusters
}

Object.entries(mistral_labels).forEach((entries, index) => {
const value = entries[1]
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ services:

sng-client:
container_name: sng-client
build: ./client-js
env_file: ./client-js/.env
build: ./client
command: "npm run dev:docker"
ports:
- "5173:5173"
Expand Down
Loading

0 comments on commit 6bad6f7

Please sign in to comment.