Skip to content
Draft
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
9 changes: 1 addition & 8 deletions .vscode/markdown.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,14 @@
"import TabItem from '@theme/TabItem';",
"",
"<Tabs groupId=\"languages\">",
"<TabItem value=\"py\" label=\"Python Client v4\">",
"<TabItem value=\"py\" label=\"Python\">",
"",
"```python",
"# Python v4 example goes here",
"# note there is an empty line before this code snippet,",
"# without the empty line the code won't render",
"```",
"</TabItem>",
"<TabItem value=\"py3\" label=\"Python Client v3\">",
"",
"```python",
"# Python v3 example goes here",
"```",
"",
"</TabItem>",
"</Tabs>",
],
"description": "Adds the tabs section for code examples"
Expand Down
11 changes: 1 addition & 10 deletions _includes/code/configuration/replication-consistency.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PyCode from '!!raw-loader!/_includes/code/howto/manage-data.collections.py';
import PyCodeV3 from '!!raw-loader!/_includes/code/howto/manage-data.collections-v3.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';


<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START AsyncRepair"
Expand All @@ -17,14 +16,6 @@ import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBl
/>
</TabItem>

<TabItem value="py3" label="Python Client v3">
<FilteredTextBlock
text={PyCodeV3}
startMarker="# START AsyncRepair"
endMarker="# END AsyncRepair"
language="pyv3"
/>
</TabItem>

<TabItem value="js" label="JS/TS Client v3">
<FilteredTextBlock
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 @@ -10,22 +10,14 @@ import JavaCode from '!!raw-loader!/_includes/code/connections/connect.java';
import GoCode from '!!raw-loader!/_includes/code/connections/connect.go';

<Tabs groupId="languages">
<TabItem value="py4" label="Python Client v4">
<TabItem value="py4" label="Python">
<FilteredTextBlock
text={PyV4Code}
startMarker="# START OIDCConnect"
endMarker="# END OIDCConnect"
language="py"
/>
</TabItem>
<TabItem value="py3" label="Python Client v3">
<FilteredTextBlock
text={PyV3Code}
startMarker="# START OIDCConnect"
endMarker="# END OIDCConnect"
language="pyv3"
/>
</TabItem>
<TabItem value="ts3" label="JS/TS Client v3">
<FilteredTextBlock
text={TsV3Code}
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 @@ -6,7 +6,7 @@ import PyV4Code from '!!raw-loader!/_includes/code/connections/connect-python-v4
import TsV3Code from '!!raw-loader!/_includes/code/connections/connect-ts-v3.ts';

<Tabs groupId="languages">
<TabItem value="py4" label="Python Client v4">
<TabItem value="py4" label="Python">
<FilteredTextBlock
text={PyV4Code}
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 @@ -6,7 +6,7 @@ import PyV4Code from '!!raw-loader!/_includes/code/connections/connect-python-v4
import TsV3Code from '!!raw-loader!/_includes/code/connections/connect-ts-v3.ts';

<Tabs groupId="languages">
<TabItem value="py4" label="Python Client v4">
<TabItem value="py4" label="Python">
<FilteredTextBlock
text={PyV4Code}
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 @@ -7,7 +7,7 @@ import TsV3Code from '!!raw-loader!/_includes/code/connections/connect-ts-v3.ts'


<Tabs groupId="languages">
<TabItem value="py4" label="Python Client v4">
<TabItem value="py4" label="Python">
<FilteredTextBlock
text={PyV4Code}
startMarker="# START TimeoutLocal"
Expand Down
11 changes: 1 addition & 10 deletions _includes/code/embedded.instantiate.custom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,18 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
import PyCode from '!!raw-loader!/_includes/code/install/embedded.py';
import PyCodeV3 from '!!raw-loader!/_includes/code/install/embedded-v3.py';
import TsCodeV2 from '!!raw-loader!/_includes/code/install/embedded-v2.ts';
import TsCodeV2CustomModules from '!!raw-loader!/_includes/code/install/embedded-v2-custommodules.ts';

<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START FullInstantiationEmbedded"
endMarker="# END FullInstantiationEmbedded"
language="py"
/>
</TabItem>
<TabItem value="py3" label="Python Client v3">
<FilteredTextBlock
text={PyCodeV3}
startMarker="# START CustomModules"
endMarker="# END CustomModules"
language="pyv3"
/>
</TabItem>
<TabItem value="js" label="JS/TS Client v2">
<FilteredTextBlock
text={TsCodeV2CustomModules}
Expand Down
11 changes: 1 addition & 10 deletions _includes/code/embedded.instantiate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,17 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
import PyCode from '!!raw-loader!/_includes/code/install/embedded.py';
import PyCodeV3 from '!!raw-loader!/_includes/code/install/embedded-v3.py';
import TsCodeV2 from '!!raw-loader!/_includes/code/install/embedded-v2.ts';

<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START SimpleInstantiationEmbedded"
endMarker="# END SimpleInstantiationEmbedded"
language="py"
/>
</TabItem>
<TabItem value="py3" label="Python Client v3">
<FilteredTextBlock
text={PyCodeV3}
startMarker="# START SimpleInstance"
endMarker="# END SimpleInstance"
language="pyv3"
/>
</TabItem>
<TabItem value="js" label="JS/TS Client v2">
<FilteredTextBlock
text={TsCodeV2}
Expand Down
11 changes: 1 addition & 10 deletions _includes/code/embedded.instantiate.module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,18 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
import PyCode from '!!raw-loader!/_includes/code/install/embedded.py';
import PyCodeV3 from '!!raw-loader!/_includes/code/install/embedded-v3.py';
import TsCodeV2 from '!!raw-loader!/_includes/code/install/embedded-v2.ts';
import TsCodeV2CustomModules from '!!raw-loader!/_includes/code/install/embedded-v2-custommodules.ts';

<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START ModuleInstantiationEmbedded"
endMarker="# END ModuleInstantiationEmbedded"
language="py"
/>
</TabItem>
<TabItem value="py3" label="Python Client v3">
<FilteredTextBlock
text={PyCodeV3}
startMarker="# START CustomModules"
endMarker="# END CustomModules"
language="pyv3"
/>
</TabItem>
<TabItem value="js" label="JS/TS Client v2">
<FilteredTextBlock
text={TsCodeV2CustomModules}
Expand Down
15 changes: 1 addition & 14 deletions _includes/code/embedded.instantiate.simple.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBl
import PyCode from '!!raw-loader!/_includes/code/tutorials/connect.py';

<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START ConnectEmbedded"
Expand All @@ -14,19 +14,6 @@ import PyCode from '!!raw-loader!/_includes/code/tutorials/connect.py';

</TabItem>

<TabItem value="py3" label="Python Client v3">

```python
import weaviate
from weaviate.embedded import EmbeddedOptions

client = weaviate.Client(
embedded_options=EmbeddedOptions()
)
```

</TabItem>

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

```js
Expand Down
36 changes: 1 addition & 35 deletions _includes/code/generative.aws.groupedresult.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,13 @@ import PyCode from '!!raw-loader!/_includes/code/generative.groupedtask.examples
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';

<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START GenerativeAWS"
endMarker="# END GenerativeAWS"
language="py"
/>
</TabItem>
<TabItem value="py3" label="Python Client v3">

```python
import weaviate

client = weaviate.Client(
url = "https://WEAVIATE_INSTANCE_URL/", # Replace WEAVIATE_INSTANCE_URL with your instance URL
additional_headers={
"X-AWS-Access-Key": "YOUR_ACCESS_KEY",
"X-AWS-Secret-Key": "YOUR_SECRET_KEY",
}
)

# highlight-start
# instruction for the generative module
generateTask = "Explain why these magazines or newspapers are about finance"
# highlight-end

result = (
client.query
.get("Publication", ["name"])
# highlight-start
.with_generate(grouped_task=generateTask)
# highlight-end
.with_near_text({
"concepts": ["magazine or newspaper about finance"]
})
.with_limit(5)
).do()

print(result)
```

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

Expand Down
36 changes: 1 addition & 35 deletions _includes/code/generative.aws.singleresult.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,13 @@ import PyCode from '!!raw-loader!/_includes/code/generative.singleprompt.example
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';

<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START GenerativeAWS"
endMarker="# END GenerativeAWS"
language="py"
/>
</TabItem>
<TabItem value="py3" label="Python Client v3">

```python
import weaviate

client = weaviate.Client(
url="https://WEAVIATE_INSTANCE_URL/", # Replace WEAVIATE_INSTANCE_URL with your instance URL
additional_headers={
"X-AWS-Access-Key": "YOUR_ACCESS_KEY",
"X-AWS-Secret-Key": "YOUR_SECRET_KEY",
}
)

# highlight-start
# instruction for the generative module
generatePrompt = "Describe the following as a Facebook Ad: {summary}"
# highlight-end

result = (
client.query
.get("Article", ["title", "summary"])
# highlight-start
.with_generate(single_prompt=generatePrompt)
# highlight-end
.with_near_text({
"concepts": ["Italian food"]
})
.with_limit(5)
).do()

print(result)
```

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

Expand Down
35 changes: 1 addition & 34 deletions _includes/code/generative.cohere.groupedresult.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,13 @@ import PyCode from '!!raw-loader!/_includes/code/generative.groupedtask.examples
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';

<Tabs groupId="languages">
<TabItem value="py" label="Python Client v4">
<TabItem value="py" label="Python">
<FilteredTextBlock
text={PyCode}
startMarker="# START GenerativeCohere"
endMarker="# END GenerativeCohere"
language="py"
/>
</TabItem>
<TabItem value="py3" label="Python Client v3">

```python
import weaviate

client = weaviate.Client(
url = "https://WEAVIATE_INSTANCE_URL/", # Replace WEAVIATE_INSTANCE_URL with your instance URL
additional_headers={
"X-Cohere-Api-Key": "YOUR-COHERE-API-KEY"
}
)

# highlight-start
# instruction for the generative module
generateTask = "Explain why these magazines or newspapers are about finance"
# highlight-end

result = (
client.query
.get("Publication", ["name"])
# highlight-start
.with_generate(grouped_task=generateTask)
# highlight-end
.with_near_text({
"concepts": ["magazine or newspaper about finance"]
})
.with_limit(5)
).do()

print(result)
```

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

Expand Down
Loading
Loading