Update ideaGen_youtube_insight.py
Browse files
ideaGen_youtube_insight.py
CHANGED
|
@@ -102,7 +102,7 @@ def ideagen_followup(content_type,context):
|
|
| 102 |
messages_base.extend([{"role": "user", "content": f"接下來,請你根據之前生成的 {context} ,想像三個campaign的示意畫面,並給我DALLE AI繪圖用來生成這個畫面的Prompt,請用realistic photo的風格。"}])
|
| 103 |
|
| 104 |
response = client.chat.completions.create(
|
| 105 |
-
model='gpt-
|
| 106 |
max_tokens=2000,
|
| 107 |
temperature=0.7,
|
| 108 |
messages=messages_base
|
|
@@ -111,7 +111,7 @@ def ideagen_followup(content_type,context):
|
|
| 111 |
|
| 112 |
total_prompt_tokens_used += response.usage.prompt_tokens
|
| 113 |
total_completion_tokens_used += response.usage.completion_tokens
|
| 114 |
-
price = total_prompt_tokens_used*0.
|
| 115 |
|
| 116 |
return completed_text , price
|
| 117 |
|
|
|
|
| 102 |
messages_base.extend([{"role": "user", "content": f"接下來,請你根據之前生成的 {context} ,想像三個campaign的示意畫面,並給我DALLE AI繪圖用來生成這個畫面的Prompt,請用realistic photo的風格。"}])
|
| 103 |
|
| 104 |
response = client.chat.completions.create(
|
| 105 |
+
model='gpt-4o',
|
| 106 |
max_tokens=2000,
|
| 107 |
temperature=0.7,
|
| 108 |
messages=messages_base
|
|
|
|
| 111 |
|
| 112 |
total_prompt_tokens_used += response.usage.prompt_tokens
|
| 113 |
total_completion_tokens_used += response.usage.completion_tokens
|
| 114 |
+
price = total_prompt_tokens_used*0.005/1000 + total_completion_tokens_used*0.015/1000
|
| 115 |
|
| 116 |
return completed_text , price
|
| 117 |
|