mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 02:03:42 +08:00
feat: XunFei ai mode api implements is ready
This commit is contained in:
@@ -67,8 +67,10 @@ var ModelToTokens = map[string]int{
|
||||
"gpt-3.5-turbo-16k": 16384,
|
||||
"gpt-4": 8192,
|
||||
"gpt-4-32k": 32768,
|
||||
"chatglm_pro": 32768,
|
||||
"chatglm_pro": 32768, // 清华智普
|
||||
"chatglm_std": 16384,
|
||||
"chatglm_lite": 4096,
|
||||
"ernie_bot_turbo": 8192, // 文心一言
|
||||
"general": 8192, // 科大讯飞
|
||||
"general2": 8192,
|
||||
}
|
||||
|
||||
@@ -36,6 +36,16 @@ func (wc *WsClient) Send(message []byte) error {
|
||||
return wc.Conn.WriteMessage(wc.mt, message)
|
||||
}
|
||||
|
||||
func (wc *WsClient) SendJson(value interface{}) error {
|
||||
wc.lock.Lock()
|
||||
defer wc.lock.Unlock()
|
||||
|
||||
if wc.Closed {
|
||||
return ErrConClosed
|
||||
}
|
||||
return wc.Conn.WriteJSON(value)
|
||||
}
|
||||
|
||||
func (wc *WsClient) Receive() (int, []byte, error) {
|
||||
if wc.Closed {
|
||||
return 0, nil, ErrConClosed
|
||||
|
||||
Reference in New Issue
Block a user