Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix api reference generation #162

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/actions/deploy-api-reference/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ runs:
./scripts/generate-api-reference.sh "${{ inputs.ragstack-version }}"
mv dist/api_reference /tmp/api_reference
git checkout gh-pages
ls -la /tmp/api_reference/${{ inputs.ragstack-version }}/langchain
mkdir -p api_reference/${{ inputs.ragstack-version }}
mv /tmp/api_reference/${{ inputs.ragstack-version }}/langchain api_reference/${{ inputs.ragstack-version }}/langchain
if [ -z "$(git status --porcelain)" ]; then
echo "Git directory is clean, nothing changed"
Expand All @@ -30,4 +32,4 @@ runs:
git add -A
git commit -m "Update api reference"
git pull --rebase origin gh-pages
git push origin gh-pages
git push origin gh-pages
6 changes: 6 additions & 0 deletions scripts/generate-api-reference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ clone_lc() {
git clone https://github.com/langchain-ai/langchain.git --branch v${langchain_version} --depth 1 /tmp/lc
}
install_requirements() {
# remove experimental up 0.0.350
sed -i '' '/-e libs\/experimental/d' docs/api_reference/requirements.txt || sed -i '/-e libs\/experimental/d' docs/api_reference/requirements.txt
cat docs/api_reference/requirements.txt
sed -i '' '/_build_rst_file(package_name="experimental")/d' docs/api_reference/create_api_rst.py || sed -i '/_build_rst_file(package_name="experimental")/d' docs/api_reference/create_api_rst.py
# remove experimental 0.0.351 onwards
rm -rf libs/experimental
poetry run pip install -r docs/api_reference/requirements.txt
}
build_docs() {
Expand Down