Skip to content
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: 2 additions & 2 deletions _includes/clients/ts-client-intro.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
The TypeScript client supports code that is written in TypeScript or JavaScript.

The **v3 client** is the current TypeScript client. If you have code written for the v2 client, you should [migrate it to v3](/weaviate/client-libraries/typescript/v2_v3_migration) as the v2 client is no longer maintained.
The **v3 client** is the current TypeScript client. If you have code written for the v2 client, you should migrate it to v3 as the v2 client is no longer maintained.

:::note

The v3 client supports server side development (Node.js hosted). If your application is browser based, you might consider using the [TypeScript client v2](/weaviate/client-libraries/typescript/typescript-v2). Keep in mind that the v2 client is outdated and no longer officially maintained.
The v3 client supports server side development (Node.js hosted). If your application is browser based, you might consider using the TypeScript client v2. Keep in mind that the v2 client is outdated and no longer officially maintained.

:::
7 changes: 0 additions & 7 deletions _includes/code/EMPTY.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ import TabItem from '@theme/TabItem';

```

</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```js

```

</TabItem>
<TabItem value="go" label="Go">

Expand Down
11 changes: 1 addition & 10 deletions _includes/code/configuration/replication-consistency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PyCode from '!!raw-loader!/_includes/code/howto/manage-data.collections.py';
import TSCode from '!!raw-loader!/_includes/code/howto/manage-data.collections.ts';
import TSCodeLegacy from '!!raw-loader!/_includes/code/howto/manage-data.collections-v2.ts';
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';


Expand All @@ -17,7 +16,7 @@ import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBl
</TabItem>


<TabItem value="js" label="JS/TS Client v3">
<TabItem value="js" label="JS/TS">
<FilteredTextBlock
text={TSCode}
startMarker="// START AsyncRepair"
Expand All @@ -26,14 +25,6 @@ import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBl
/>
</TabItem>

<TabItem value="js2" label="JS/TS Client v2">
<FilteredTextBlock
text={TSCodeLegacy}
startMarker="// START AsyncRepair"
endMarker="// END AsyncRepair"
language="tsv2"
/>
</TabItem>
<TabItem value="curl" label="cURL">

```bash
Expand Down
10 changes: 1 addition & 9 deletions _includes/code/connections/oidc-connect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,14 @@ import GoCode from '!!raw-loader!/_includes/code/connections/connect.go';
language="py"
/>
</TabItem>
<TabItem value="ts3" label="JS/TS Client v3">
<TabItem value="ts3" label="JS/TS">
<FilteredTextBlock
text={TsV3Code}
startMarker="// START OIDCConnect"
endMarker="// END OIDCConnect"
language="js"
/>
</TabItem>
<TabItem value="ts2" label="JS/TS Client v2">
<FilteredTextBlock
text={TsV2Code}
startMarker="// START OIDCConnect"
endMarker="// END OIDCConnect"
language="tsv2"
/>
</TabItem>
<TabItem value="go" label="Go">
<FilteredTextBlock
text={GoCode}
Expand Down
2 changes: 1 addition & 1 deletion _includes/code/connections/timeouts-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import TsV3Code from '!!raw-loader!/_includes/code/connections/connect-ts-v3.ts'
language="py"
/>
</TabItem>
<TabItem value="ts3" label="JS/TS Client v3">
<TabItem value="ts3" label="JS/TS">
<FilteredTextBlock
text={TsV3Code}
startMarker="// START TimeoutWCD"
Expand Down
2 changes: 1 addition & 1 deletion _includes/code/connections/timeouts-custom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import TsV3Code from '!!raw-loader!/_includes/code/connections/connect-ts-v3.ts'
language="py"
/>
</TabItem>
<TabItem value="ts3" label="JS/TS Client v3">
<TabItem value="ts3" label="JS/TS">
<FilteredTextBlock
text={TsV3Code}
startMarker="// START TimeoutCustom"
Expand Down
2 changes: 1 addition & 1 deletion _includes/code/connections/timeouts-local.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import TsV3Code from '!!raw-loader!/_includes/code/connections/connect-ts-v3.ts'
language="py"
/>
</TabItem>
<TabItem value="ts3" label="JS/TS Client v3">
<TabItem value="ts3" label="JS/TS">
<FilteredTextBlock
text={TsV3Code}
startMarker="// START TimeoutLocal"
Expand Down
20 changes: 0 additions & 20 deletions _includes/code/contextionary.extensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,6 @@ client = weaviate.Client("http://localhost:8080")
client.contextionary.extend("weaviate", "Open source cloud native real time vector database", 1.0)
```

</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```js
import weaviate from 'weaviate-ts-client';

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});

const response = await client.c11y
.extensionCreator()
.withConcept('weaviate')
.withDefinition('Open source cloud native real time vector database')
.withWeight(1)
.do();
console.log(JSON.stringify(response, null, 2));
```

</TabItem>
<TabItem value="go" label="Go">

Expand Down
18 changes: 0 additions & 18 deletions _includes/code/contextionary.get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,6 @@ concept_info = client.contextionary.get_concept_vector("fashionMagazine")
print(concept_info)
```

</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```js
import weaviate from 'weaviate-ts-client';

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});

const response = await client.c11y
.conceptsGetter()
.withConcept('fashionMagazine')
.do();
console.log(JSON.stringify(response, null, 2));
```

</TabItem>
<TabItem value="go" label="Go">

Expand Down
19 changes: 0 additions & 19 deletions _includes/code/core.client.openai.apikey.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,6 @@ client = weaviate.Client(
)
```

</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```js
import weaviate from 'weaviate-ts-client';

const client = weaviate.client({
scheme: 'https',
host: 'WEAVIATE_INSTANCE_URL',
// highlight-start
// Replace with your API key
headers: {
'X-OpenAI-Api-Key': 'YOUR-OPENAI-API-KEY',
'X-Azure-Api-Key': 'YOUR-AZURE-API-KEY',
},
// highlight-end
});
```

</TabItem>
<TabItem value="go" label="Go">

Expand Down
8 changes: 0 additions & 8 deletions _includes/code/embedded.instantiate.custom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,4 @@ import TsCodeV2CustomModules from '!!raw-loader!/_includes/code/install/embedded
language="py"
/>
</TabItem>
<TabItem value="js" label="JS/TS Client v2">
<FilteredTextBlock
text={TsCodeV2CustomModules}
startMarker="// START CustomModules"
endMarker="// END CustomModules"
language="tsv2"
/>
</TabItem>
</Tabs>
8 changes: 0 additions & 8 deletions _includes/code/embedded.instantiate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,4 @@ import TsCodeV2 from '!!raw-loader!/_includes/code/install/embedded-v2.ts';
language="py"
/>
</TabItem>
<TabItem value="js" label="JS/TS Client v2">
<FilteredTextBlock
text={TsCodeV2}
startMarker="// START SimpleInstance"
endMarker="// END SimpleInstance"
language="tsv2"
/>
</TabItem>
</Tabs>
8 changes: 0 additions & 8 deletions _includes/code/embedded.instantiate.module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,4 @@ import TsCodeV2CustomModules from '!!raw-loader!/_includes/code/install/embedded
language="py"
/>
</TabItem>
<TabItem value="js" label="JS/TS Client v2">
<FilteredTextBlock
text={TsCodeV2CustomModules}
startMarker="// START CustomModules"
endMarker="// END CustomModules"
language="tsv2"
/>
</TabItem>
</Tabs>
17 changes: 1 addition & 16 deletions _includes/code/embedded.instantiate.simple.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,12 @@ import PyCode from '!!raw-loader!/_includes/code/tutorials/connect.py';

</TabItem>

<TabItem value="js" label="JS/TS Client v3">
<TabItem value="js" label="JS/TS">

```js
// Coming soon
```

</TabItem>

<TabItem value="js2" label="JS/TS Client v2">

```js
import weaviate, { EmbeddedOptions } from 'weaviate-ts-embedded';

const client = weaviate.client(new EmbeddedOptions());

await client.embedded.start();

// Work with Weaviate

client.embedded.stop();
```

</TabItem>
</Tabs>
33 changes: 0 additions & 33 deletions _includes/code/generative.anyscale.groupedresult.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,39 +65,6 @@ result = (
print(result)
```

</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```ts
import weaviate, { ApiKey } from 'weaviate-ts-client';

const client = weaviate.client({
scheme: 'https',
host: 'edu-demo.weaviate.network',
apiKey: new ApiKey('learn-weaviate'),
headers: { 'X-Anyscale-Api-Key': process.env['ANYSCALE_API_KEY'] },
});

// highlight-start
// instruction for the generative module
const generateTask = 'Please answer the question: What is ref2vec? based on the following search results. IMPORTANT! Please make sure your answer is supported by the information in the search results and provide references to the provided content when possible.';
// highlight-end

const response = await client.graphql
.get()
.withClassName('PodClip')
.withFields('speaker content')
.withNearText({
concepts: ['What is ref2vec?'],
})
.withGenerate({
groupedTask: generateTask,
})
.withLimit(5)
.do();
console.log(JSON.stringify(response, null, 2));
```

</TabItem>
<TabItem value="go" label="Go">

Expand Down
30 changes: 0 additions & 30 deletions _includes/code/generative.anyscale.singleresult.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,6 @@ result = (
print(result)
```

</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```ts
import weaviate, { ApiKey } from 'weaviate-ts-client';

const client = weaviate.client({
scheme: 'https',
host: 'edu-demo.weaviate.network',
apiKey: new ApiKey('learn-weaviate'),
headers: { 'X-Anyscale-Api-Key': process.env['ANYSCALE_API_KEY'] },
});

// highlight-start
// instruction for the generative module
const generatePrompt = 'Please summarize the following podcast clip into one sentence. Speaker: {speaker} said {content}.';
// highlight-end

const response = await client.graphql
.get()
.withClassName('PodClip')
.withFields('speaker content')
.withGenerate({
singlePrompt: generatePrompt,
})
.withLimit(1)
.do();
console.log(JSON.stringify(response, null, 2));
```

</TabItem>
<TabItem value="go" label="Go">

Expand Down
36 changes: 0 additions & 36 deletions _includes/code/generative.aws.groupedresult.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,6 @@ import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBl
endMarker="# END GenerativeAWS"
language="py"
/>
</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```ts
import weaviate, { ApiKey } from 'weaviate-ts-client';

const client = weaviate.client({
scheme: 'https',
host: 'edu-demo.weaviate.network',
apiKey: new ApiKey('learn-weaviate'),
headers: {
'X-AWS-Access-Key': 'YOUR_ACCESS_KEY',
'X-AWS-Secret-Key': 'YOUR_SECRET_KEY'
},
});

// highlight-start
// instruction for the generative module
const generateTask = 'Explain why these magazines or newspapers are about finance';
// highlight-end

const response = await client.graphql
.get()
.withClassName('Article')
.withFields('title')
.withNearText({
concepts: ['magazine or newspaper about finance'],
})
.withGenerate({
groupedTask: generateTask,
})
.withLimit(5)
.do();
console.log(JSON.stringify(response, null, 2));
```

</TabItem>
<TabItem value="go" label="Go">

Expand Down
Loading
Loading