langchain/libs/partners/anthropic/tests/integration_tests
Jacob Lee 181a61982f
anthropic[minor]: Adds streaming tool call support for Anthropic (#22687)
Preserves string content chunks for non tool call requests for
convenience.

One thing - Anthropic events look like this:

```
RawContentBlockStartEvent(content_block=TextBlock(text='', type='text'), index=0, type='content_block_start')
RawContentBlockDeltaEvent(delta=TextDelta(text='<thinking>\nThe', type='text_delta'), index=0, type='content_block_delta')
RawContentBlockDeltaEvent(delta=TextDelta(text=' provide', type='text_delta'), index=0, type='content_block_delta')
...
RawContentBlockStartEvent(content_block=ToolUseBlock(id='toolu_01GJ6x2ddcMG3psDNNe4eDqb', input={}, name='get_weather', type='tool_use'), index=1, type='content_block_start')
RawContentBlockDeltaEvent(delta=InputJsonDelta(partial_json='', type='input_json_delta'), index=1, type='content_block_delta')
```

Note that `delta` has a `type` field. With this implementation, I'm
dropping it because `merge_list` behavior will concatenate strings.

We currently have `index` as a special field when merging lists, would
it be worth adding `type` too?

If so, what do we set as a context block chunk? `text` vs.
`text_delta`/`tool_use` vs `input_json_delta`?

CC @ccurme @efriis @baskaryan
2024-06-14 09:14:43 -07:00
..
__init__.py
test_chat_models.py anthropic[minor]: Adds streaming tool call support for Anthropic (#22687) 2024-06-14 09:14:43 -07:00
test_compile.py
test_experimental.py infra: bump anthropic mypy 1 (#22373) 2024-06-03 08:21:55 -07:00
test_llms.py infra: bump anthropic mypy 1 (#22373) 2024-06-03 08:21:55 -07:00
test_standard.py multiple: standard chat model tests (#20359) 2024-04-11 18:23:13 -07:00