Skip to content

Chatbots

chat_azure()
Chat with a model hosted on Azure OpenAI
chat_bedrock()
Chat with an AWS bedrock model
chat_claude()
Chat with an Anthropic Claude model
chat_cortex_analyst()
Create a chatbot that speaks to the Snowflake Cortex Analyst
chat_databricks()
Chat with a model hosted on Databricks
chat_deepseek()
Chat with a model hosted on DeepSeek
chat_gemini()
Chat with a Google Gemini model
chat_github()
Chat with a model hosted on the GitHub model marketplace
chat_groq()
Chat with a model hosted on Groq
chat_ollama()
Chat with a local Ollama model
chat_openai()
Chat with an OpenAI model
chat_openrouter()
Chat with one of the many models hosted on OpenRouter
chat_perplexity()
Chat with a model hosted on perplexity.ai
chat_snowflake()
Chat with a model hosted on Snowflake
chat_vllm()
Chat with a model hosted by vLLM
token_usage()
Report on token usage in the current session

Chat helpers

create_tool_def()
Create metadata for a tool
content_image_url() content_image_file() content_image_plot()
Encode images for chat input
content_pdf_file() content_pdf_url()
Encode PDFs content for chat input
live_console() live_browser()
Open a live chat application
interpolate() interpolate_file()
Helpers for interpolating data into prompts
gemini_upload() experimental
Upload a file to gemini

Tools and structured data

Objects

These classes abstact across behaviour differences in chat providers so that for typical ellmer use you don’t need to worry about them. You’ll need to learn more about the objects if you’re doing something that’s only supported by one provider, or if you’re implementing a new provider.

Turn()
A user or assistant turn
Provider()
A chatbot provider
Content() ContentText() ContentImage() ContentImageRemote() ContentImageInline() ContentToolRequest() ContentToolResult() ContentPDF()
Content types received from and sent to a chatbot
Chat
A chat
TypeBasic() TypeEnum() TypeArray() TypeObject()
Type definitions for function calling and structured data extraction.

Utilities

contents_text() contents_html() contents_markdown()
Format contents into a textual representation