diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-09-05 15:26:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-05 15:26:08 +0200 |
commit | ae9702ecf05562f47fdcdc005a2a36124c6cc567 (patch) | |
tree | 5015b50c0e9f679aa2682d2064418d5473de9637 /g4f/Provider/AiService.py | |
parent | Merge pull request #875 from Lin-jun-xiang/annotations (diff) | |
parent | Join the messages (diff) | |
download | gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.gz gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.bz2 gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.lz gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.xz gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.zst gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.zip |
Diffstat (limited to 'g4f/Provider/AiService.py')
-rw-r--r-- | g4f/Provider/AiService.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/g4f/Provider/AiService.py b/g4f/Provider/AiService.py index f4de2836..2b5a6e7d 100644 --- a/g4f/Provider/AiService.py +++ b/g4f/Provider/AiService.py @@ -18,10 +18,8 @@ class AiService(BaseProvider): stream: bool, **kwargs: Any, ) -> CreateResult: - base = "" - for message in messages: - base += "%s: %s\n" % (message["role"], message["content"]) - base += "assistant:" + base = "\n".join(f"{message['role']}: {message['content']}" for message in messages) + base += "\nassistant: " headers = { "accept": "*/*", |