Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cohere: include preamble with date #3514

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fastchat/serve/api_provider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Call API providers."""

from datetime import date
import json
import os
import random
Expand Down Expand Up @@ -976,9 +977,15 @@ def cohere_api_stream_iter(
]
actual_prompt = messages[-1]["content"]

date_str = date.today().strftime("%b %d, %Y")
preamble = f"You are a large language model called Command built by the \
company Cohere. You act as a brilliant, sophisticated, AI-assistant chatbot trained \
to assist human users by providing thorough responses. Today's date is {date_str}."

gen_params = {
"model": model_id,
"messages": messages,
"preamble": preamble,
"chat_history": chat_history,
"prompt": actual_prompt,
"temperature": temperature,
Expand Down
Loading