# ol.llx.ai.impl.adapters.anthropic-messages

_platforms: clj, cljs_

## normalize-tool-call-id

### clj

_platforms: clj_

```clojure
(normalize-tool-call-id tool-call-id _target-model _source-assistant-message)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L43-L49)

### cljs

_platforms: cljs_

```clojure
(normalize-tool-call-id tool-call-id _target-model _source-assistant-message)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L43-L49)

---

## build-request

### clj

_platforms: clj_

```clojure
(build-request env model context opts)
(build-request env model context opts stream?)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L202-L277)

### cljs

_platforms: cljs_

```clojure
(build-request env model context opts)
(build-request env model context opts stream?)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L202-L277)

---

## finalize

### clj

_platforms: clj_

```clojure
(finalize env state-or-response)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L309-L331)

### cljs

_platforms: cljs_

```clojure
(finalize env state-or-response)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L309-L331)

---

## decode-event

### clj

_platforms: clj_

```clojure
(decode-event env state raw-chunk)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L358-L475)

### cljs

_platforms: cljs_

```clojure
(decode-event env state raw-chunk)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L358-L475)

---

## normalize-error

### clj

_platforms: clj_

```clojure
(normalize-error env ex partial-state)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L477-L502)

### cljs

_platforms: cljs_

```clojure
(normalize-error env ex partial-state)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L477-L502)

---

## handle-open-stream-response

### clj

_platforms: clj_

```clojure
(handle-open-stream-response env model response)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L504-L529)

### cljs

_platforms: cljs_

```clojure
(handle-open-stream-response env model response)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L504-L529)

---

## open-stream

### clj

_platforms: clj_

```clojure
(open-stream env _model request-map)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L531-L536)

### cljs

_platforms: cljs_

```clojure
(open-stream env _model request-map)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L531-L536)

---

## adapter

### clj

_platforms: clj_

```clojure
(adapter)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L538-L549)

### cljs

_platforms: cljs_

```clojure
(adapter)
```

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/adapters/anthropic_messages.cljc#L538-L549)
