An open API service indexing awesome lists of open source software.

https://github.com/context-labs/context-sdk-py


https://github.com/context-labs/context-sdk-py

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          


Context Python SDK

⚡ Python SDK for accessing the Context API




Twitter URL


pypi Package


Twitter URL

- [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
```