Skip to content

Commit 2eda23f

Browse files
authored
feat: Bedrock model id support for jamba-1.5 (#212)
* feat: Bedrock model id support for jamba-1.5 * fix: Bedrock examples
1 parent e811d74 commit 2eda23f

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ messages = [
560560

561561
response = client.chat.completions.create(
562562
messages=messages,
563-
model_id=BedrockModelID.JAMBA_INSTRUCT_V1,
563+
model_id=BedrockModelID.JAMBA_1_5_LARGE,
564564
)
565565
```
566566

@@ -582,7 +582,7 @@ client = AI21BedrockClient()
582582

583583
response = client.chat.completions.create(
584584
messages=messages,
585-
model=BedrockModelID.JAMBA_INSTRUCT_V1,
585+
model=BedrockModelID.JAMBA_1_5_LARGE,
586586
stream=True,
587587
)
588588

@@ -607,7 +607,7 @@ messages = [
607607
async def main():
608608
response = await client.chat.completions.create(
609609
messages=messages,
610-
model_id=BedrockModelID.JAMBA_INSTRUCT_V1,
610+
model_id=BedrockModelID.JAMBA_1_5_LARGE,
611611
)
612612

613613

@@ -633,7 +633,7 @@ messages = [
633633

634634
response = client.chat.completions.create(
635635
messages=messages,
636-
model_id=BedrockModelID.JAMBA_INSTRUCT_V1,
636+
model_id=BedrockModelID.JAMBA_1_5_LARGE,
637637
)
638638
```
639639

@@ -658,7 +658,7 @@ messages = [
658658
async def main():
659659
response = await client.chat.completions.create(
660660
messages=messages,
661-
model_id=BedrockModelID.JAMBA_INSTRUCT_V1,
661+
model_id=BedrockModelID.JAMBA_1_5_LARGE,
662662
)
663663

664664
asyncio.run(main())

ai21/clients/bedrock/bedrock_model_id.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ class BedrockModelID:
22
J2_MID_V1 = "ai21.j2-mid-v1"
33
J2_ULTRA_V1 = "ai21.j2-ultra-v1"
44
JAMBA_INSTRUCT_V1 = "ai21.jamba-instruct-v1:0"
5+
JAMBA_1_5_MINI = "ai21.jamba-1-5-mini-v1:0"
6+
JAMBA_1_5_LARGE = "ai21.jamba-1-5-large-v1:0"

examples/bedrock/chat/async_chat_completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
async def main():
1414
response = await client.chat.completions.create(
1515
messages=messages,
16-
model=BedrockModelID.JAMBA_INSTRUCT_V1,
16+
model=BedrockModelID.JAMBA_1_5_MINI,
1717
)
1818

1919
print(f"response: {response}")

examples/bedrock/chat/async_stream_chat_completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
async def main():
1717
response = await client.chat.completions.create(
1818
messages=messages,
19-
model=BedrockModelID.JAMBA_INSTRUCT_V1,
19+
model=BedrockModelID.JAMBA_1_5_MINI,
2020
max_tokens=100,
2121
stream=True,
2222
)

examples/bedrock/chat/chat_completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
messages=messages,
2323
max_tokens=1000,
2424
temperature=0,
25-
model=BedrockModelID.JAMBA_INSTRUCT_V1,
25+
model=BedrockModelID.JAMBA_1_5_MINI,
2626
)
2727

2828
print(f"response: {response}")

examples/bedrock/chat/stream_chat_completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
response = client.chat.completions.create(
1515
messages=messages,
16-
model=BedrockModelID.JAMBA_INSTRUCT_V1,
16+
model=BedrockModelID.JAMBA_1_5_MINI,
1717
max_tokens=100,
1818
stream=True,
1919
)

0 commit comments

Comments
 (0)