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

# Go SDK

> QWED Go SDK documentation. Install via go get, use context-based verification methods, and handle errors idiomatically in your Go applications.

## Installation

```bash theme={null}
go get github.com/qwed-ai/qwed-go
```

## Quick start

```go theme={null}
package main

import (
    "context"
    "fmt"
    "github.com/qwed-ai/qwed-go"
)

func main() {
    client := qwed.NewClient("qwed_your_key")
    
    result, err := client.Verify(context.Background(), "Is 2+2=4?")
    if err != nil {
        panic(err)
    }
    
    fmt.Println(result.Verified)  // true
    fmt.Println(result.Status)    // "VERIFIED"
}
```

## Methods

### Verify

```go theme={null}
result, err := client.Verify(ctx, "2+2=4")
```

### VerifyMath

```go theme={null}
result, err := client.VerifyMath(ctx, "x**2 + 2*x + 1 = (x+1)**2")
fmt.Println(result.Verified)  // true
```

### VerifyLogic

```go theme={null}
result, err := client.VerifyLogic(ctx, "(AND (GT x 5) (LT y 10))")
fmt.Println(result.Model)  // map[x:6 y:9]
```

### VerifyCode

```go theme={null}
result, err := client.VerifyCode(ctx, code, "python")
for _, vuln := range result.Vulnerabilities {
    fmt.Printf("%s: %s\n", vuln.Severity, vuln.Message)
}
```

### VerifySQL

```go theme={null}
result, err := client.VerifySQL(ctx, query, schema)
```

### VerifyBatch

```go theme={null}
items := []qwed.BatchItem{
    {Query: "2+2=4", Type: qwed.TypeMath},
    {Query: "3*3=9", Type: qwed.TypeMath},
}
results, err := client.VerifyBatch(ctx, items)
fmt.Println(results.Summary.SuccessRate)
```

## Types

```go theme={null}
type VerificationResult struct {
    Status          string
    Verified        bool
    Engine          string
    Result          map[string]interface{}
    Vulnerabilities []Vulnerability
}
```

## Error handling

```go theme={null}
result, err := client.Verify(ctx, "test")
if err != nil {
    var qwedErr *qwed.Error
    if errors.As(err, &qwedErr) {
        fmt.Println(qwedErr.Code)
        fmt.Println(qwedErr.Message)
    }
}
```
