as-cle-bert commited on
Commit
a5cde82
1 Parent(s): 933d8db

Update ChatCohere.py

Browse files
Files changed (1) hide show
  1. ChatCohere.py +5 -4
ChatCohere.py CHANGED
@@ -16,10 +16,11 @@ def chat_completion(message: str) -> str:
16
  return response.message.content[0].text
17
 
18
  def summarize(message, system_prompt="You are an helpful assistant whose job is to summarize the text you are given in less than 900 charachters (including spaces) in such a way that it would constitute an effective and engaging description of a pokemon card package"):
19
- response = chat_completion(
20
- message_history=[
 
21
  {"role": "system", "content": system_prompt},
22
  {"role": "user", "content": message},
23
  ]
24
- )
25
- return response
 
16
  return response.message.content[0].text
17
 
18
  def summarize(message, system_prompt="You are an helpful assistant whose job is to summarize the text you are given in less than 900 charachters (including spaces) in such a way that it would constitute an effective and engaging description of a pokemon card package"):
19
+ response = co.chat(
20
+ model="command-r-plus-08-2024",
21
+ messages=[
22
  {"role": "system", "content": system_prompt},
23
  {"role": "user", "content": message},
24
  ]
25
+ )
26
+ return response.message.content[0].text