chat_with_files
Ask Grok questions about previously uploaded files by attaching their file IDs as context, so it can read and quote contents; optionally save chat history per session.
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.6`).
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.6 | |
| prompt | Yes | ||
| session | No | ||
| file_ids | Yes | ||
| show_usage | No | ||
| system_prompt | No |