diff options
Diffstat (limited to 'src/client/apis/gpt')
-rw-r--r-- | src/client/apis/gpt/GPT.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts index 455352068..7af71a6a2 100644 --- a/src/client/apis/gpt/GPT.ts +++ b/src/client/apis/gpt/GPT.ts @@ -119,7 +119,7 @@ const gptGetEmbedding = async (src: string): Promise<number[]> => { }); // Assume the embeddingResponse structure is correct; adjust based on actual API response - const embedding = embeddingResponse.data[0].embedding; + const { embedding } = embeddingResponse.data[0]; return embedding; } catch (err) { console.log(err); @@ -155,9 +155,8 @@ const gptImageLabel = async (src: string): Promise<string> => { }); if (response.choices[0].message.content) { return response.choices[0].message.content; - } else { - return 'Missing labels'; } + return 'Missing labels'; } catch (err) { console.log(err); return 'Error connecting with API'; |