mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-28 02:23:52 +02:00
add qianfan ut code and update xx_llm from xx_gpt
This commit is contained in:
parent
dc240a2efd
commit
d3f6e38e8a
11 changed files with 153 additions and 80 deletions
|
|
@ -5,6 +5,7 @@ import copy
|
|||
import os
|
||||
|
||||
import qianfan
|
||||
from qianfan import ChatCompletion
|
||||
from qianfan.resources.typing import JsonBody
|
||||
from tenacity import (
|
||||
after_log,
|
||||
|
|
@ -78,7 +79,7 @@ class QianFanLLM(BaseLLM):
|
|||
|
||||
# self deployed model on the cloud not to calculate usage, it charges resource pool rental fee
|
||||
self.calc_usage = self.config.calc_usage and self.config.endpoint is None
|
||||
self.aclient = qianfan.ChatCompletion()
|
||||
self.aclient: ChatCompletion = qianfan.ChatCompletion()
|
||||
|
||||
def _const_kwargs(self, messages: list[dict], stream: bool = False) -> dict:
|
||||
kwargs = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue