Tim Seufert commited on
Commit
4defe67
·
1 Parent(s): 8bd0eab

update interface beta test2

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -21,12 +21,15 @@ co = cohere.Client(api_key=api_key)
21
  def respond(message, history):
22
  """Einfache Antwortfunktion für das Gradio-Chatinterface"""
23
  try:
24
- full_prompt = f"{prompt} '{message}'"
25
- response = co.chat(
26
- model='command-r-08-2024',
27
- query=full_prompt,
28
  temperature=0.3,
29
- ).generations[0].text.strip()
 
 
 
30
 
31
  return response
32
  except Exception as e:
@@ -36,7 +39,7 @@ def respond(message, history):
36
  # Einfaches ChatInterface erstellen
37
  demo = gr.ChatInterface(
38
  fn=respond,
39
- title="Tim Seufert Chatbot",
40
  description="Stellen Sie mir Ihre Fragen, und ich werde versuchen, Ihnen zu helfen!",
41
  theme="soft",
42
  examples=["Wie geht es dir?", "Was ist künstliche Intelligenz?", "Erkläre mir Quantenphysik einfach."],
 
21
  def respond(message, history):
22
  """Einfache Antwortfunktion für das Gradio-Chatinterface"""
23
  try:
24
+
25
+ response = co.chat_stream(
26
+ model='command-r-plus-08-2024',
27
+ message=f"{prompt} '{message}'",
28
  temperature=0.3,
29
+ chat_history=[], # Consider using chat_history for context
30
+ prompt_truncation='AUTO',
31
+ connectors=[{"id": "web-search"}]
32
+ )
33
 
34
  return response
35
  except Exception as e:
 
39
  # Einfaches ChatInterface erstellen
40
  demo = gr.ChatInterface(
41
  fn=respond,
42
+ title="TimSeufert Chatbot",
43
  description="Stellen Sie mir Ihre Fragen, und ich werde versuchen, Ihnen zu helfen!",
44
  theme="soft",
45
  examples=["Wie geht es dir?", "Was ist künstliche Intelligenz?", "Erkläre mir Quantenphysik einfach."],