Skip to content

Commit

Permalink
fix(all): 🐛 minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Yunus Andréasson <yunus@edenmind.com>
  • Loading branch information
YunusAndreasson committed Nov 17, 2023
1 parent f968c74 commit ecc094f
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions api/controllers/texts.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ async function addText(request, reply) {
const views = 0 //initially, the text has no views
const slug = slugifyWithAuthor(body.title, body.author) //generate a slug
const createdAt = new Date()
const textGuid = uuidv4().slice(0, 8)
const data = {
textGuid,
title: body.title,
slug,
author: body.author,
Expand All @@ -93,6 +95,8 @@ async function addText(request, reply) {
status: body.status
}

console.log('data: ', data)

// Validate that no objects are empty
// data: the data being validated
// Returns: true if no objects are empty, false otherwise
Expand All @@ -104,9 +108,6 @@ async function addText(request, reply) {
//remove url from text.image with removeHost
data.image = removeHost(data.image)

//generate a guid for the text
data.textGuid = uuidv4().slice(0, 8)

if (data.status !== 'Draft') {
//generate a guid for every sentence and word
data.sentences = generateGuidForSentencesAndWords(body.sentences)
Expand Down
Binary file modified mobile/.yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"homepage": "https://openarabic.io",
"repository": "https://github.com/edenmind/OpenArabic",
"version": "1445.2.408",
"version": "1445.2.409",
"authors": [
"Yunus Andreasson <yunus@edenmind.com> (https://github.com/YunusAndreasson)"
],
Expand Down
2 changes: 1 addition & 1 deletion package/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: open-arabic-helm
description: A Helm Chart for OpenArabic
version: 1444.0.317
version: 1444.0.318
apiVersion: v2
type: application
home: https://openarabic.io
Expand Down
Binary file modified web/.yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"homepage": "https://openarabic.io",
"repository": "https://github.com/edenmind/OpenArabic",
"version": "1444.12.241",
"version": "1444.12.242",
"authors": [
"Yunus Andreasson <yunus@edenmind.com> (https://github.com/YunusAndreasson)"
],
Expand Down
2 changes: 1 addition & 1 deletion web/src/screens/text-add-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function TextAddPublish() {

const updateText = () => {
//adjust before posting

console.log('text: ', text)
api
.updateText(text, id)
.then((res) => {
Expand Down
2 changes: 2 additions & 0 deletions web/src/screens/text-add-words.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable no-multiple-empty-lines */
/* eslint-disable no-trailing-spaces */
/* eslint-disable implicit-arrow-linebreak */
Expand Down Expand Up @@ -32,6 +33,7 @@ function TextAddWords() {
const prompt = prompts.getArabicAndEnglishSentence(sentence, text)

const jsonString = await getChatCompletionMessage(prompt)
console.log(jsonString)
const result = JSON.parse(jsonString)

handleChangeArabicFullSentence(indexSentence, result)
Expand Down
2 changes: 1 addition & 1 deletion web/src/services/ai-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const openai = new OpenAI({
export async function getChatCompletionMessage(message) {
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: 'user', content: message }],
model: 'gpt-4-1106-preview',
model: 'gpt-4',
temperature: 0,
max_tokens: 1024,
top_p: 0.5,
Expand Down

0 comments on commit ecc094f

Please sign in to comment.