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

docs: Adding fern python documentation #100

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ankush-cohere
Copy link
Contributor

@ankush-cohere ankush-cohere commented Mar 12, 2025

This PR introduces new Python scripts for various operations related to the Compass SDK. The scripts are added to the examples/fern_documentation/python/core directory and cover a range of functionalities, including creating and deleting indexes, searching documents, and managing document assets.

Changes:

  • Addition of new Python scripts:
    • add_metadata.py: Adds metadata to documents using the CompassClient and DocumentAttributes classes.
    • create_index.py: Creates a new index using the CompassClient class.
    • delete_doc.py: Deletes a document using the CompassClient class.
    • delete_index.py: Deletes an index using the CompassClient class.
    • direct_search_index.py: Performs a direct search within an index, returning a list of RetrievedChunkExtended objects.
    • get_doc_asset.py: Retrieves a document asset using the CompassClient class.
    • get_document.py: Retrieves a document using the CompassClient class.
    • list_index.py: Lists all indexes and their details using the CompassClient class.
    • put_doc_into_index.py: Inserts documents into an index using the CompassClient and CompassParserClient classes.
    • refresh_index.py: Refreshes an index using the CompassClient class.
    • search_chunks.py: Searches for chunks within an index using the CompassClient class.
    • search_doc.py: Searches for documents within an index using the CompassClient class.
    • update_group_auth.py: Updates group authorization for documents using the CompassClient and GroupAuthorizationInput classes.
    • upload_files.py: Uploads files to an index using the CompassClient and DocumentAttributes classes.
  • Import statements:
    • The import argparse statement in search_documents.py is now indented.

@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch 2 times, most recently from e850014 to 5e595d7 Compare March 12, 2025 11:44
@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch 2 times, most recently from 65fbe90 to 2619c60 Compare March 12, 2025 16:49
@ankush-cohere ankush-cohere changed the title Adding fern python documentation docs: Adding fern python documentation Mar 12, 2025
@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch from 2619c60 to 85c74a3 Compare March 13, 2025 09:17
@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch 2 times, most recently from 27a3d57 to f993f16 Compare March 13, 2025 10:40
@ankush-cohere ankush-cohere marked this pull request as ready for review March 13, 2025 11:02
@ankush-cohere ankush-cohere requested a review from a team as a code owner March 13, 2025 11:02
@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch from f993f16 to 0ae6f7d Compare March 13, 2025 11:10
luca-cohere
luca-cohere previously approved these changes Mar 13, 2025
Copy link
Contributor

@luca-cohere luca-cohere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. For sake of uniformity with the other examples I would pass cli arguments instead of env variables but this way works too.

@ankush-cohere
Copy link
Contributor Author

I would pass cli arguments instead of env variables but this way works too.

This will go to fern examples, and want it to make it as simple as possible... It looks something like this

Screenshot 2025-03-13 at 17 19 18

Copy link
Member

@corafid corafid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added several comments.

Also, the source code of the package is under compass_sdk_examples (which is the name of the package), so I would move the fern_documentation folder under it.

@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch from 80ed1cd to d9b6825 Compare March 14, 2025 10:30
@benrules3
Copy link
Contributor

Super valuable work here @ankush-cohere - thank you for putting in the work for all these examples!!

benrules3
benrules3 previously approved these changes Mar 14, 2025
Copy link
Contributor

@benrules3 benrules3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions - but wouldn't block! Would like to hear if there's a good reason on the os.getenv usage though.

@ankush-cohere ankush-cohere dismissed stale reviews from benrules3 and artemiyatcohere via 4cfa57b March 14, 2025 14:52
@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch from 7fade43 to 4cfa57b Compare March 14, 2025 14:52
@ankush-cohere ankush-cohere force-pushed the SEA-2015/fern_examples branch from 4172cad to 843bcaf Compare March 14, 2025 16:56
Copy link
Contributor

@benrules3 benrules3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes, ty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants