|
605 | 605 | end |
606 | 606 | end |
607 | 607 | end |
| 608 | + |
| 609 | + describe "#parse_model_id" do |
| 610 | + it "strips the 'us.' prefix" do |
| 611 | + input = "us.anthropic.claude-3-5-sonnet-20240620-v1:0" |
| 612 | + result = subject.send(:parse_model_id, input) |
| 613 | + expect(result).to eq(["anthropic", "claude-3-5-sonnet-20240620-v1:0"]) |
| 614 | + end |
| 615 | + |
| 616 | + it "strips the 'eu.' prefix" do |
| 617 | + input = "eu.anthropic.claude-3-5-sonnet-20240620-v1:0" |
| 618 | + result = subject.send(:parse_model_id, input) |
| 619 | + expect(result).to eq(["anthropic", "claude-3-5-sonnet-20240620-v1:0"]) |
| 620 | + end |
| 621 | + |
| 622 | + it "strips the 'apac.' prefix" do |
| 623 | + input = "apac.anthropic.claude-3-5-sonnet-20240620-v1:0" |
| 624 | + result = subject.send(:parse_model_id, input) |
| 625 | + expect(result).to eq(["anthropic", "claude-3-5-sonnet-20240620-v1:0"]) |
| 626 | + end |
| 627 | + |
| 628 | + it "strips the 'us-gov.' prefix" do |
| 629 | + input = "us-gov.anthropic.claude-3-5-sonnet-20240620-v1:0" |
| 630 | + result = subject.send(:parse_model_id, input) |
| 631 | + expect(result).to eq(["anthropic", "claude-3-5-sonnet-20240620-v1:0"]) |
| 632 | + end |
| 633 | + |
| 634 | + it "returns the correct output when no region prefix is present" do |
| 635 | + input = "anthropic.claude-3-5-sonnet-20240620-v1:0" |
| 636 | + result = subject.send(:parse_model_id, input) |
| 637 | + expect(result).to eq(["anthropic", "claude-3-5-sonnet-20240620-v1:0"]) |
| 638 | + end |
| 639 | + end |
608 | 640 | end |
0 commit comments