AS AgentScopeAPI 手册 / API Reference

OllamaMediaConverter

public class OllamaMediaConverter
源码Source io/agentscope/extensions/model/ollama/formatter/OllamaMediaConverter.java:31–73

Ollama Media 转换器,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.extensions.model.ollama.formatter 包。核心成员包括 convertImageBlockToBase64。

Handles media content conversion for Ollama API. Converts ImageBlock to Base64 strings as required by Ollama.

方法摘要Method Summary

方法Method说明Description
public String convertImageBlockToBase64(ImageBlock imageBlock) throws Exception
转换图像块到基类 64。
Convert ImageBlock to Base64 string for Ollama API.

方法详情Method Detail

convertImageBlockToBase64

public String convertImageBlockToBase64(ImageBlock imageBlock) throws Exception

转换图像块到基类 64。

Convert ImageBlock to Base64 string for Ollama API.

参数Parameters
名称Name类型Type说明Description
imageBlockImageBlock图像块到转换。The image block to convert
返回Returns String
返回字符串结果。Base64 encoded string of the image
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/model/ollama/formatter/OllamaMediaConverter.java:50–72
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.