https://github.com/context-labs/context-sdk-py
https://github.com/context-labs/context-sdk-py
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/context-labs/context-sdk-py
- Owner: context-labs
- Created: 2023-07-21T22:50:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-21T23:02:52.000Z (almost 3 years ago)
- Last Synced: 2025-06-24T19:36:56.495Z (12 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Context Python SDK
⚡ Python SDK for accessing the Context API ⚡
- [How to use it](#how-to-use-it)
- [Instantiate the SDK](#instantiate-the-sdk)
- [Search for documents/snippets](#search-for-documentssnippets)
## How to use it
### Instantiate the SDK
```py
from context import ContextSdk, ContextSdkConfig
sdk = ContextSdk(
ContextSdkConfig(
api_key="", # your API key
)
)
```
### Search for documents/snippets
```py
bot_id = "k7rB5_3JT"
query = "How can I get started with Helius?"
top_k = 1
result = self.sdk.search(bot_id, query, top_k)
print(result) # will be a list of snippets
```