> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# File Match • Rust AI Agent SDK

> FileMatch: A file match from a search.

# FileMatch

> Defined in the [**context**](../modules/context) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

A file match from a search.

## Fields

| Name              | Type                   | Description                       |
| ----------------- | ---------------------- | --------------------------------- |
| `path`            | `String`               | File path (relative to workspace) |
| `relevance_score` | `f32`                  | Relevance score (0.0 to 1.0)      |
| `line_ranges`     | `Vec&lt;LineRange&gt;` | Matching line ranges              |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(path: impl Into<String>) -> Self
```

Create a new file match.

**Parameters:**

| Name   | Type                      |
| ------ | ------------------------- |
| `path` | `impl Into&lt;String&gt;` |

### `relevance_score`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn relevance_score(mut self, score: f32) -> Self
```

Set relevance score.

**Parameters:**

| Name    | Type  |
| ------- | ----- |
| `score` | `f32` |

### `line_range`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn line_range(mut self, range: LineRange) -> Self
```

Add a line range.

**Parameters:**

| Name    | Type        |
| ------- | ----------- |
| `range` | `LineRange` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/context/mod.rs#L597">
  `praisonai/src/context/mod.rs` at line 597
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Files" icon="file" href="/docs/rust/files" />

  <Card title="Rust Documents" icon="file-lines" href="/docs/rust/documents" />
</CardGroup>
