chat_with_files
Ask questions or give instructions about uploaded files, using Grok to read and quote their contents.
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.3`).
system_prompt: Optional system instruction prepended to the conversation.
show_usage: Append a token usage and cost footer to the reply (default False).
Returns:
Assistant reply, followed by a `**Sources:**` list when the model cites URLs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | grok-4.3 | |
| prompt | Yes | ||
| session | No | ||
| file_ids | Yes | ||
| show_usage | No | ||
| system_prompt | No |