chat_with_files
Ask questions about uploaded files to get AI-powered answers with cited sources from their content.
Instructions
Chat with Grok using one or more previously uploaded files as context.
Attaches the given `file_ids` to the user turn so Grok can read/quote their
contents. Optional `session` persists local chat history across calls.
Args:
prompt: Question or instruction about the attached files.
file_ids: IDs of files previously returned by `upload_file`.
session: Optional session name for persistent history in `chats/{session}.json`.
model: Grok model id (default `grok-4-1-fast-reasoning`).
system_prompt: Optional system instruction prepended to the conversation.
Returns:
Assistant reply, followed by a `**Sources:**` list when the model cites URLs.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| file_ids | Yes | ||
| session | No | ||
| model | No | grok-4-1-fast-reasoning | |
| system_prompt | No |