Skip to content

Commit d687ce7

Browse files
committed
feat: address feedback on Bedrock LLM support PR
- Update documentation to include Bedrock LLM integration. - Remove unnecessary test for LlmApiType.BEDROCK. - Add Bedrock to the existing manuals_llm_extraction example instead of creating a new one.
1 parent 736b580 commit d687ce7

File tree

12 files changed

+29
-249
lines changed

12 files changed

+29
-249
lines changed

docs/docs/ai/llm.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ We support the following types of LLM APIs:
2828
| [LiteLLM](#litellm) | `LlmApiType.LITE_LLM` |||
2929
| [OpenRouter](#openrouter) | `LlmApiType.OPEN_ROUTER` |||
3030
| [vLLM](#vllm) | `LlmApiType.VLLM` |||
31+
| [Bedrock](#bedrock) | `LlmApiType.BEDROCK` |||
3132

3233
## LLM Tasks
3334

@@ -440,3 +441,28 @@ cocoindex.LlmSpec(
440441

441442
</TabItem>
442443
</Tabs>
444+
445+
### Bedrock
446+
447+
To use the Bedrock API, you need to set up AWS credentials. You can do this by setting the following environment variables:
448+
449+
- `AWS_ACCESS_KEY_ID`
450+
- `AWS_SECRET_ACCESS_KEY`
451+
- `AWS_SESSION_TOKEN` (optional)
452+
453+
A spec for Bedrock looks like this:
454+
455+
<Tabs>
456+
<TabItem value="python" label="Python" default>
457+
458+
```python
459+
cocoindex.LlmSpec(
460+
api_type=cocoindex.LlmApiType.BEDROCK,
461+
model="us.anthropic.claude-3-5-haiku-20241022-v1:0",
462+
)
463+
```
464+
465+
</TabItem>
466+
</Tabs>
467+
468+
You can find the full list of models supported by Bedrock [here](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html).

examples/bedrock_llm_extraction/.env.example

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/bedrock_llm_extraction/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/bedrock_llm_extraction/README.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

examples/bedrock_llm_extraction/main.py

Lines changed: 0 additions & 138 deletions
This file was deleted.
-371 KB
Binary file not shown.
-424 KB
Binary file not shown.
-190 KB
Binary file not shown.
-320 KB
Binary file not shown.

examples/bedrock_llm_extraction/pyproject.toml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)