ollama.generate和ollama.chat的区别是什么? #2

Closed
opened 2026-02-15 16:27:22 -05:00 by yindo · 2 comments
Owner

Originally created by @haomes on GitHub (Jan 23, 2024).

Originally created by @haomes on GitHub (Jan 23, 2024).
yindo closed this issue 2026-02-15 16:27:22 -05:00
Author
Owner

@MostlyKIGuess commented on GitHub (Jan 24, 2024):

What's the issue btw?

@MostlyKIGuess commented on GitHub (Jan 24, 2024): What's the issue btw?
Author
Owner

@mxyng commented on GitHub (Jan 25, 2024):

ollama.generate calls ollama's generate endpoint which is intended for text or code completion but can also be used for chat. it takes prompt, template, and system as its main input fields.

ollama.chat calls ollama's chat endpoint which is specialized for chat interactions. it takes messages as its main input field

@mxyng commented on GitHub (Jan 25, 2024): `ollama.generate` calls ollama's generate endpoint which is intended for text or code completion but can also be used for chat. it takes `prompt`, `template`, and `system` as its main input fields. `ollama.chat` calls ollama's chat endpoint which is specialized for chat interactions. it takes `messages` as its main input field
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#2