Ronio Jerico Roque commited on
Commit ·
5c0e929
1
Parent(s): fca2084
fix: reduce typing delay in stream_string method for improved user experience
Browse files- classes/Target_Market.py +1 -3
classes/Target_Market.py
CHANGED
|
@@ -12,8 +12,6 @@ from newsapi import NewsApiClient
|
|
| 12 |
import requests
|
| 13 |
from requests import sessions
|
| 14 |
from openai import OpenAI
|
| 15 |
-
from pprint import pprint
|
| 16 |
-
from rocketchat_API.rocketchat import RocketChat
|
| 17 |
|
| 18 |
class TargetMarketAnalyst:
|
| 19 |
def __init__(self, model_url, analyst_name, data_src, analyst_description):
|
|
@@ -114,7 +112,7 @@ class TargetMarketAnalyst:
|
|
| 114 |
# Add assistant response to chat history
|
| 115 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 116 |
|
| 117 |
-
def stream_string(self, text, delay=0.
|
| 118 |
for char in text:
|
| 119 |
yield char
|
| 120 |
time.sleep(delay) # Small delay to simulate typing
|
|
|
|
| 12 |
import requests
|
| 13 |
from requests import sessions
|
| 14 |
from openai import OpenAI
|
|
|
|
|
|
|
| 15 |
|
| 16 |
class TargetMarketAnalyst:
|
| 17 |
def __init__(self, model_url, analyst_name, data_src, analyst_description):
|
|
|
|
| 112 |
# Add assistant response to chat history
|
| 113 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 114 |
|
| 115 |
+
def stream_string(self, text, delay=0.003):
|
| 116 |
for char in text:
|
| 117 |
yield char
|
| 118 |
time.sleep(delay) # Small delay to simulate typing
|