Skip to content

图像理解

图像事件判断及行业知识方案

POST http://{ip:port}/uran/lm/question

请求参数

名称 类型 是否必须 说明
messages ObjectArrary Y 待搜索的问题集合
+role String Y 角色user, assistant
+content String Y 搜索问题
+images String N 图像url
maxTokens Int Y 限制最大token数
temperature Float Y 想象力
model String Y 模型名
repository Object N 指定要搜索的知识库/如果没有则属于对话模式
+name String Y 知识库名
+threshold Float Y 搜索阈值
+topK Int Y 指定搜索结果的topK
background String N 背景信息描述

响应参数 ( 流式text/event-stream )

名称 类型 是否必须 说明
data Object Y 返回产生的结果[DONE]表示完成
+choices ObjectArray Y
++delta Object Y
+++role/step/content String Y role=assistant,step=当前正在发生进行的步骤, content=模型回复的消息

请求示例

{
    "maxTokens": 128,
    "temperature": 0.7,
    "messages": [
        {
            "role": "user",
            "content": "请帮我描述下这个图片里的内容",
            "images": "http://10.10.8.5:30601/storage/files/1669551431047143425.jpg"
        }
    ],
    "model": "koala-mm",
    "repository": {
        "repository": "铁塔高空监控",
        "threshold": 0.5,
        "topK": 2
    },
    "background" : "repository"
}

响应示例

data: { "choices": [{"delta": {"step": "正在解析图片内容"}}]}

data: { "choices": [{"delta": {"step": "正在检索知识库"}}]}

data: { "choices": [{"delta": {"step": "正在组织解决方案"}}]}

data: { "choices": [{"delta": {"role": "assistant"}}]}
data: { "choices": [{"delta": {"content": "火灾"}}]}

data: { "choices": ["delta": {"content": "发生"}}]}