chat_with_files
Ask questions about your uploaded files and get answers based on their contents. Use file IDs to attach context, with optional session history for persistent conversations.
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.
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.3 | |
| system_prompt | No |