Skip to content

Commit 7b76910

Browse files
committed
fix(contexts): replace hyper.contexts.list with hyper.contexts.all
1 parent 47f129c commit 7b76910

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ Now you're ready to start querying language models with your own custom contexts
137137

138138
Hypercode allows you to programmatically manage your contexts that are created inside the [Hyper App](https://app.gethyper.ai). You can get information about the created contexts, and more methods are coming soon. More information about contexts can be found [here](https://docs.gethyper.ai/context).
139139

140-
**Here's a quick example of how you can use Hypercode to list down all the contexts:**
140+
**Here's a quick example of how you can use Hypercode to get all the contexts:**
141141

142142
```javascript
143-
const { data: contexts, error } = await hyper.contexts.list();
143+
const { data: contexts, error } = await hyper.contexts.all();
144144

145145
console.log(contexts); // [{ id: 'context-id-1', name: 'Context 1', created_at: '2023-10-28T04:28:13.971776+00:00' }, { id: 'context-id-2', name: 'Context 2', created_at: '2023-11-02T22:18:44.978052+00:00' }]
146146
```

src/contexts/contexts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('Hypercode contexts API methods', () => {
3636
status: 200,
3737
});
3838

39-
const result = await hyper.contexts.list();
39+
const result = await hyper.contexts.all();
4040

4141
expect(result.data).toEqual(expectedResult);
4242
expect(fetchMock).toHaveBeenLastCalledWith(

src/contexts/contexts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export class Contexts {
88
* Get all of the available contexts. More information: https://docs.gethyper.ai/context#get-v1-contexts
99
* @returns All of the available contexts in the Hyper app (https://app.gethyper.ai)
1010
* @example
11-
* const { data, error } = await hyper.contexts.list();
11+
* const { data, error } = await hyper.contexts.all();
1212
* console.log(data);
1313
*/
14-
async list() {
14+
async all() {
1515
const res = await this.hyper.get<AllContexts>({
1616
endpoint: '/contexts',
1717
});

src/hyper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class Hyper {
4444
/**
4545
* Hyper Contexts API. Context groups in the Hyper app serve as collections of data aggregated from files, web URLs, and third-party integrations. They play a crucial role in refining search results and tailoring the contextual data provided to large language models. More information: https://docs.gethyper.ai/context
4646
* @example
47-
* const { data, error } = await hyper.contexts.list();
47+
* const { data, error } = await hyper.contexts.all();
4848
*/
4949
readonly contexts = new Contexts(this);
5050

src/search/@types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type MethodParamsOptions = {
22
/**
3-
* The context ID to be used for the request, you can get all context IDs by calling `hyper.contexts.list()` and then using the `id` field from the response.
3+
* The context ID to be used for the request, you can get all context IDs by calling `hyper.contexts.all()` and then using the `id` field from the response.
44
*/
55
contextId: string;
66
};

src/types/@types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type AllowedTypes =
1212

1313
export type MethodParamsOptions = {
1414
/**
15-
* The context ID to be used for the request, you can get all context IDs by calling `hyper.contexts.list()` and then using the `id` field from the response.
15+
* The context ID to be used for the request, you can get all context IDs by calling `hyper.contexts.all()` and then using the `id` field from the response.
1616
*/
1717
contextId: string;
1818
};

0 commit comments

Comments
 (0)