You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,13 +72,18 @@ Extention of [ChatAIStream](https://github.com/GeneralYadoc/ChatAIStream) for vo
72
72
system_role = "You are a cheerful assistant who speek English and can get conversation exciting with user."
73
73
)
74
74
75
+
# Set params of streamer
76
+
streamer_params=casr.streamerParams(
77
+
voice_generator=myVoiceGenerator(),
78
+
answer_with_voice_cb=answer_with_voice_cb
79
+
)
80
+
75
81
# Create ChatAIStreamer instance.
76
82
ai_streamer =casr.ChatAIStreamer(
77
83
casr.params(
78
84
stream_params=stream_params,
79
85
ai_params=ai_params,
80
-
voice_generator=myVoiceGenerator(),
81
-
answer_with_voice_cb=answer_with_voice_cb
86
+
streamer_params=streamer_params
82
87
)
83
88
)
84
89
@@ -177,16 +182,18 @@ Extention of [ChatAIStream](https://github.com/GeneralYadoc/ChatAIStream) for vo
177
182
# You can choose other language by its 'lang=' argument like 'ja'.
178
183
# If you want to change language, Please change the assignment for system role of ai params also.
179
184
# The instance isn't necessary for English generator.
180
-
voice_generator=gasr.GttsGenerator(lang='en')
185
+
streamer_params=gasr.streamerParams(
186
+
voice_generator=gasr.GttsGenerator(lang='en'),
187
+
answer_with_voice_cb=answer_with_voice_cb
188
+
)
181
189
182
190
# Create GttsAIStreamer instance.
183
191
# 'voice_generator=' is omittable for English generator.
184
192
ai_streamer =gasr.GttsAIStreamer(
185
193
gasr.params(
186
194
stream_params=stream_params,
187
195
ai_params=ai_params,
188
-
voice_generator=voice_generator,
189
-
answer_with_voice_cb=answer_with_voice_cb
196
+
streamer_params=streamer_params
190
197
)
191
198
)
192
199
@@ -257,16 +264,17 @@ Extention of [ChatAIStream](https://github.com/GeneralYadoc/ChatAIStream) for vo
257
264
| ask_cb | user message given to ChatGPT is thrown to this callback | None |
258
265
| max_messages_in_context | Max messages in context given to ChatGPT | 20 |
259
266
| answer_cb | ChatGPT answer is thrown to this callback | None |
260
-
| answer_with_voice_cb | ChatGPT answer is thrown to this callback with voice data created by your get method of voiceGenerator | None |
261
267
| max_queue_size | Max slots of internal queue (0 is no limit) | 10 |
262
268
| model | Model of AI to be used. | None |
263
269
| max_tokens_per_request | Max number of tokens which can be contained in a request | 256 |
264
270
| interval_sec | Interval of ChatGPT API call | 20.0 \[sec\]|
265
271
266
-
### voiceGenerator
272
+
### streamerParams
267
273
| name | description | default |
268
274
|------|------------|---------|
269
-
| voice_generator | the instance of inherited class of voiceGenerater made by you | - |
275
+
| voice_generator | the instance of inherited class of voiceGenerater made by you | None |
276
+
| answer_with_voice_cb | ChatGPT answer is thrown to this callback with voice data created by your get method of voiceGenerator | None |
277
+
| max_queue_size | max size of internal queue which stocks GPT answer which will be given to voice Generator | 1 |
270
278
271
279
### Notice
272
280
- Please refer [pytchat README](https://github.com/taizan-hokuto/pytchat) to know the type of YouTube Chat item used by get_item_cb, pre_filter_cb and post filter_cb.
0 commit comments