Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2e577a2
feat: convrag added to client, fix response mapping
amirai21 Nov 12, 2024
af51e52
feat: convrag added to client, fix response mapping
amirai21 Nov 12, 2024
90558ac
feat: quality fix
amirai21 Nov 14, 2024
d18d558
fix: Semantic Release
asafgardin Nov 12, 2024
90ef1d1
fix: Semantic Release rc config
asafgardin Nov 12, 2024
193a695
fix: Semantic Release rc config
asafgardin Nov 12, 2024
b578c32
fix: Semantic Release rc config
asafgardin Nov 12, 2024
a91cc53
fix: Semantic Release rc config
asafgardin Nov 12, 2024
3601a12
fix: Semantic Release rc config
asafgardin Nov 12, 2024
a651403
fix: New Version
asafgardin Nov 12, 2024
de11620
chore(release): 1.0.0-rc.1 [skip ci]
semantic-release-bot Nov 12, 2024
896c039
fix: Semantic Release rc config
asafgardin Nov 12, 2024
c9ae5d5
fix: Update version script
asafgardin Nov 12, 2024
a029559
fix: Semantic config
asafgardin Nov 12, 2024
e21a3a9
fix: Path to script
asafgardin Nov 12, 2024
b56482d
chore(release): 1.0.0-rc.1 [skip ci]
semantic-release-bot Nov 12, 2024
1e82d0e
ci: Fix release config
asafgardin Nov 12, 2024
1e444ea
fix: New Version
asafgardin Nov 12, 2024
626ae30
fix: Semantic Release rc config
asafgardin Nov 12, 2024
59b51b4
fix: Path to script
asafgardin Nov 12, 2024
f5d518e
chore(release): 1.0.0-rc.2 [skip ci]
semantic-release-bot Nov 12, 2024
8855940
fix: tsconfig.json
asafgardin Nov 12, 2024
0e0e768
chore(release): 1.0.0-rc.3 [skip ci]
semantic-release-bot Nov 12, 2024
510859c
fix: Empty commit
asafgardin Nov 12, 2024
98b8a47
fix: License in README
asafgardin Nov 12, 2024
9f67360
fix: Response in readme
asafgardin Nov 12, 2024
b34a1ba
fix: Streaming examples
asafgardin Nov 12, 2024
4b6e229
chore(release): 1.0.0-rc.4 [skip ci]
semantic-release-bot Nov 12, 2024
8a8ad3c
feat: added husky
amirai21 Nov 14, 2024
d933250
feat: export rag types
amirai21 Nov 17, 2024
c2d8318
feat: export rag types
amirai21 Nov 17, 2024
a7a1dee
feat: conv rag happy flow unit tests
amirai21 Nov 17, 2024
bc282e1
feat: tests wip
amirai21 Nov 18, 2024
4ad46f9
fix: New Version
asafgardin Nov 12, 2024
16b9be3
fix: Semantic Release rc config
asafgardin Nov 12, 2024
01c7dcf
fix: Path to script
asafgardin Nov 12, 2024
6ccdb92
fix: Empty commit
asafgardin Nov 12, 2024
156aed0
feat: Added browser support
asafgardin Nov 13, 2024
cf23c6b
fix: Typing of both fetches
asafgardin Nov 13, 2024
2f750fe
feat: Decoder per implemtation
asafgardin Nov 13, 2024
72ceaa6
fix: Quality fixes
asafgardin Nov 13, 2024
1acf5c1
fix: tests
asafgardin Nov 13, 2024
f1ebdd2
fix: Version
asafgardin Nov 14, 2024
d622002
refactor: Removed comments
asafgardin Nov 14, 2024
e7af4ec
fix: Updated bundler to use vite
asafgardin Nov 14, 2024
de77175
fix: Naming of Response
asafgardin Nov 14, 2024
7ae56f8
fix: CR
asafgardin Nov 14, 2024
3cd091d
fix: Folder name
asafgardin Nov 14, 2024
224635f
fix: Naming of imports
asafgardin Nov 14, 2024
336ed4c
chore(release): 1.0.0-rc.5 [skip ci]
semantic-release-bot Nov 14, 2024
241c386
fix: Added dangerouslyAllowBrowser
asafgardin Nov 15, 2024
70b2d75
fix: Test
asafgardin Nov 15, 2024
a691e66
docs: Added docs for open source
asafgardin Nov 18, 2024
42d3f8b
docs: Added examples
asafgardin Nov 18, 2024
183d25c
fix: Lint and Formatting
asafgardin Nov 18, 2024
a6cc7ea
refactor: Moved conversational rag example under examples folder
asafgardin Nov 18, 2024
e9b3cec
fix: Stream examples
asafgardin Nov 18, 2024
9841f8d
ci: Tests only on push
asafgardin Nov 18, 2024
47632cc
fix: Folder and file name
asafgardin Nov 18, 2024
5415890
ci: Added labeler
asafgardin Nov 18, 2024
8386b37
ci: Added deps-dev to semantic pr
asafgardin Nov 18, 2024
ead6410
fix: package-json.lock
asafgardin Nov 18, 2024
5b47e43
chore(release): 1.0.0-rc.1 [skip ci]
semantic-release-bot Nov 18, 2024
718e9a0
ci: Fixed labeler
asafgardin Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.

# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.

# The following GitHub teams can be used within this file:
# @AI21/devops
# @AI21/writing
* @reach
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: Josephasafg, pazshalev, amirai21, miri-bar

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]
- Browser [e.g. chrome, safari]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
34 changes: 34 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Add 'Documentation' label to any change to .md files within the entire repository
documentation:
- changed-files:
- any-glob-to-any-file: "**/*.md"

# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
feature:
- head-branch: ["^feat", "feat:"]

# Add 'release' label to any PR that is opened against the `main` branch
fix:
- head-branch: ["^bugfix", "fix:"]

ci:
- head-branch: ["^ci", "ci:"]
- changed-files:
- any-glob-to-any-file:
- .github/*

aws:
- changed-files:
- any-glob-to-any-file:
- ai21/clients/bedrock/*
- ai21/clients/sagemaker/*

azure:
- changed-files:
- any-glob-to-any-file:
- ai21/clients/azure/*

vertex:
- changed-files:
- any-glob-to-any-file:
- ai21/clients/vertex/*
127 changes: 127 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: "Pull Request Labeler"
on:
pull_request_review:
types: [submitted]
pull_request_review_comment:
types: [created, deleted]
pull_request_target:
types: [opened, edited, reopened, synchronize]

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Labeler
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch all branches
run: git fetch --all

- name: Determine base and head branches
id: branches
run: |
base_branch=$(jq -r '.pull_request.base.ref' "$GITHUB_EVENT_PATH")
head_branch=$(jq -r '.pull_request.head.ref' "$GITHUB_EVENT_PATH")
echo $base_branch
echo $head_branch
echo "base_branch=$base_branch" >> $GITHUB_ENV
echo "head_branch=$head_branch" >> $GITHUB_ENV

- name: Calculate diff size
id: diff
env:
BASE_BRANCH: ${{ env.base_branch }}
HEAD_BRANCH: ${{ env.head_branch }}
run: |
echo $BASE_BRANCH
echo $HEAD_BRANCH
git checkout $HEAD_BRANCH
git fetch origin $BASE_BRANCH
diff_output=$(git diff --shortstat origin/$BASE_BRANCH...$HEAD_BRANCH)
echo $diff_output
insertions=$(echo $diff_output | awk '{print ($4 == "" ? 0 : $4)}')
deletions=$(echo $diff_output | awk '{print ($6 == "" ? 0 : $6)}')
changed_lines=$((insertions + deletions))
echo $changed_lines
echo "changed_lines=$changed_lines" >> $GITHUB_ENV

- name: Determine label
env:
CHANGED_LINES: ${{ env.changed_lines }}
id: label
run: |
changed_lines=$CHANGED_LINES
if [ "$changed_lines" -le 9 ]; then
label="size:s"
elif [ "$changed_lines" -le 50 ]; then
label="size:m"
elif [ "$changed_lines" -le 100 ]; then
label="size:l"
elif [ "$changed_lines" -le 500 ]; then
label="size:xl"
else
label="size:xxl"
fi
echo "label=$label" >> $GITHUB_ENV

- name: Fetch current labels
id: fetch_labels
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
return labels.map(label => label.name);

- name: Remove old size labels
id: remove_labels
uses: actions/github-script@v7
env:
NEW_SIZE_LABEL: ${{ env.label }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const sizeLabels = ['size:s', 'size:m', 'size:l', 'size:xl', 'size:xxl'];
const newLabel = "${{ env.NEW_SIZE_LABEL }}";
const currentLabels = ${{ steps.fetch_labels.outputs.result }};
const labelsToRemove = currentLabels.filter(label => sizeLabels.includes(label) && label !== newLabel);
for (const label of labelsToRemove) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: label,
});
}

- name: Add label to PR
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}

add_lgtm_label:
runs-on: ubuntu-latest
if: github.event.review.state == 'APPROVED'

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Add LGTM label
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: lgtm
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Install semantic-release
run: |
npm install --save-dev semantic-release @semantic-release/git @semantic-release/github
npm install --save-dev semantic-release @semantic-release/git @semantic-release/github @semantic-release/exec

- name: Build package
run: npm run build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ jobs:
requireScope: false
wip: true
validateSingleCommit: true
scopes: |
deps-dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Unittest

on: [push, pull_request]
on: [push]

jobs:
test:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@ dist/
node_modules/
.cursorrules
.vscode/
coverage/
coverage/
.env*
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run quality:fix
15 changes: 10 additions & 5 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/npm", {
"npmPublish": true
"npmPublish": true,
"tag": "next"
}],
["@semantic-release/exec", {
"prepareCmd": "node update-version.js ${nextRelease.version}"
}],
["@semantic-release/git", {
"assets": ["package.json", "src/version.ts"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
"pushTo": ["origin ${branch.name}"]
}],
["@semantic-release/github", {
"labels": ["release-candidate"],
"releasedLabels": ["released-rc"]
}],
["@semantic-release/git", {
"assets": ["package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
Loading
Loading