Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI 代理 Wasm 插件对接百度文心一言 #941

Open
Tracked by #940
CH3CHO opened this issue May 15, 2024 · 4 comments · May be fixed by #1024
Open
Tracked by #940

AI 代理 Wasm 插件对接百度文心一言 #941

CH3CHO opened this issue May 15, 2024 · 4 comments · May be fixed by #1024

Comments

@CH3CHO
Copy link
Collaborator

CH3CHO commented May 15, 2024

No description provided.

@hanxiantao
Copy link
Contributor

申请认领下这个任务,麻烦帮忙分配下 @CH3CHO

@CH3CHO CH3CHO changed the title 百度文心一言(链接) AI 代理 Wasm 插件对接百度文心一言 May 15, 2024
@hanxiantao
Copy link
Contributor

@CH3CHO 您好,开发过程中有个问题沟通下,百度文心一言不同模型的url是不同的,不是通过requestBody中的model来区分的,如果要进行模型映射的话,需要在OnRequestBody中根据requestBody中的model来生成不同的requestPath,然后调用_ = util.OverwriteRequestPath(requestPath)方法替换请求头中的:path
但是验证的时候,我这边发现OnRequestBody方法中不能再修改请求头了(报错:error status returned by host: bad argument),这种好像只能参考azureServiceUrl这种手工配置地址了,无法进行模型映射
您看下有没有什么其他的建议
百度文心一言文档

@CH3CHO
Copy link
Collaborator Author

CH3CHO commented May 18, 2024

@CH3CHO 您好,开发过程中有个问题沟通下,百度文心一言不同模型的url是不同的,不是通过requestBody中的model来区分的,如果要进行模型映射的话,需要在OnRequestBody中根据requestBody中的model来生成不同的requestPath,然后调用_ = util.OverwriteRequestPath(requestPath)方法替换请求头中的:path 但是验证的时候,我这边发现OnRequestBody方法中不能再修改请求头了(报错:error status returned by host: bad argument),这种好像只能参考azureServiceUrl这种手工配置地址了,无法进行模型映射 您看下有没有什么其他的建议 百度文心一言文档

可以先参考 Azure 的实现。后续会支持在 OnRequestBody 阶段修改 Header,到时候可以再调整。

@hanxiantao
Copy link
Contributor

OnRequestBody

@CH3CHO 您好,开发过程中有个问题沟通下,百度文心一言不同模型的url是不同的,不是通过requestBody中的model来区分的,如果要进行模型映射的话,需要在OnRequestBody中根据requestBody中的model来生成不同的requestPath,然后调用_ = util.OverwriteRequestPath(requestPath)方法替换请求头中的:path 但是验证的时候,我这边发现OnRequestBody方法中不能再修改请求头了(报错:error status returned by host: bad argument),这种好像只能参考azureServiceUrl这种手工配置地址了,无法进行模型映射 您看下有没有什么其他的建议 百度文心一言文档

可以先参考 Azure 的实现。后续会支持在 OnRequestBody 阶段修改 Header,到时候可以再调整。

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants