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
import os
from ChatAgent import serve
from ChatAgent.chat_models.base_chat_model import BaseChatModel
from ChatAgent.agents.zhipu_chat_agent import ZhipuChatAgent
from ChatAgent.protocol.openai_api_protocol import MultimodalityChatCompletionRequest
import os
from ChatAgent import serve
from ChatAgent.chat_models.base_chat_model import BaseChatModel
from ChatAgent.agents.zhipu_chat_agent import ZhipuChatAgent
from ChatAgent.protocol.openai_api_protocol import MultimodalityChatCompletionRequest
apikey = "xxxx"
class GLM4(BaseChatModel):
def init_agent(self):
self.agent = ZhipuChatAgent(model_name="glm-4", api_key=apikey)
def create_chat_completion(self, request):
return self.agent.act(request)
@serve.create_chat_completion()
async def implement_completions(request: MultimodalityChatCompletionRequest):
return GLM4().create_chat_completion(request)
serve.run(host="localhost", port=6368)
The text was updated successfully, but these errors were encountered: