Liking cljdoc? Tell your friends :D

im.ttalk.agent.provider.ollama

Ollama Provider —— 本地模型,OpenAI 兼容端点(统一由 base/defprovider 生成)。

(require '[im.ttalk.agent.provider.ollama :as ollama]) (def provider (ollama/create-provider {:model "llama2"}))

Ollama Provider —— 本地模型,OpenAI 兼容端点(统一由 base/defprovider 生成)。

- :base-url 默认 http://localhost:11434/v1
- 不需要 API key(预置假 key "ollama")
- create-provider 必须提供 :model

(require '[im.ttalk.agent.provider.ollama :as ollama])
(def provider (ollama/create-provider {:model "llama2"}))
raw docstring

call-ollamaclj

(call-ollama config__10075__auto__ messages__10076__auto__ tools__10077__auto__)

调用 ollama API(同步)

调用 ollama API(同步)
sourceraw docstring

call-ollama-asyncclj

(call-ollama-async config__10075__auto__
                   messages__10076__auto__
                   tools__10077__auto__)

异步调用 ollama API(返回 deferred<响应体>)

异步调用 ollama API(返回 deferred<响应体>)
sourceraw docstring

call-ollama-streamclj

(call-ollama-stream config__10075__auto__
                    messages__10076__auto__
                    tools__10077__auto__
                    on-token__10078__auto__)

流式调用 ollama API

流式调用 ollama API
sourceraw docstring

call-ollama-stream-asyncclj

(call-ollama-stream-async config__10075__auto__
                          messages__10076__auto__
                          tools__10077__auto__
                          on-token__10078__auto__)

异步流式调用 ollama API(返回 deferred<最终响应>)

异步流式调用 ollama API(返回 deferred<最终响应>)
sourceraw docstring

create-providerclj

(create-provider)
(create-provider opts10385)

创建 ollama Provider

创建 ollama Provider
sourceraw docstring

default-configclj

默认 ollama 配置

默认 ollama 配置
sourceraw docstring

list-modelsclj

(list-models)

列出 Ollama 上可用的模型。返回模型列表 map 或 {:error "..."}

列出 Ollama 上可用的模型。返回模型列表 map 或 {:error "..."}
sourceraw docstring

pull-modelclj

(pull-model model-name)

拉取 Ollama 模型。返回拉取结果 map 或 {:error "..."}

拉取 Ollama 模型。返回拉取结果 map 或 {:error "..."}
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close