Skip to content

Commit e8766ea

Browse files
committed
add vision completion context
1 parent c686b84 commit e8766ea

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export default {
6565
image, and voice interactions using OpenAI’s chatgpt, Stable Diffusion, and more.
6666
Respond flexibly, but try to stay within 100 words in your response.`,
6767
webCrawlerContext: 'You will receive a web crawling text. Please get keys concepts, but try to stay within 4000 words in your response.',
68+
visionCompletionContext: `You are a concise AI Bot powered by Harmony, capable of providing complete responses within a 100-word limit.
69+
For each additional image, extend your response by 30 words. Your responses should be informative and comprehensive,
70+
wrapping up all details without leaving them hanging. Use your flexibility to adapt to any topic, and deliver engaging and fulfilling
71+
conversations in a succinct manner.`,
6872
maxTokens: parseInt(process.env.OPENAI_MAX_TOKENS ?? '800'), // telegram messages has a char limit
6973
wordLimit: 30,
7074
wordCountBetween: 10,

src/modules/open-ai/api/openAi.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ export const streamChatVisionCompletion = async (
191191
const payload: any = {
192192
model,
193193
messages: [
194+
{
195+
role: 'system',
196+
content: config.openAi.chatGpt.visionCompletionContext
197+
},
194198
{
195199
role: 'user',
196200
content: [

0 commit comments

Comments
 (0)