Skip to content

Commit

Permalink
Merge branch 'main' of weaviate/weaviate-io into feat/landing-page
Browse files Browse the repository at this point in the history
  • Loading branch information
malgamves committed Dec 25, 2024
2 parents b445b43 + 14c1340 commit 35becdc
Show file tree
Hide file tree
Showing 1,532 changed files with 45,486 additions and 4,157 deletions.
81 changes: 66 additions & 15 deletions .vscode/python.code-snippets
Original file line number Diff line number Diff line change
@@ -1,27 +1,78 @@
{
"Weaviate WCD connect": {
"prefix": "Weaviate-wcd-connect",
"Weaviate Starter Code - Local": {
"prefix": "weaviate-starter-local",
"description": "Create a new Weaviate collection: local w/ Ollama",
"body": [
"import weaviate",
"from weaviate.classes.config import Configure, Property, DataType",
"",
"client = weaviate.connect_to_local()",
"",
"collection_name = \"${1:TempCollection}\"",
"",
"client.collections.delete(collection_name)",
"",
"client.collections.create(",
" collection_name,",
" properties=[",
" Property(\"${2:title}\", DataType.TEXT),",
" Property(\"${3:body}\", DataType.TEXT),${4}",
" ],",
" vectorizer_config=[",
" Configure.NamedVectors.text2vec_ollama(",
" name=\"default\",",
" source_properties=[\"${2:title}\", \"${3:body}\"],",
" api_endpoint=\"${5:http://host.docker.internal:11434}\",",
" model=\"${6:snowflake-arctic-embed}\",",
" )",
" ],",
" generative_config=Configure.Generative.text2vec_ollama(",
" api_endpoint=\"${5:http://host.docker.internal:11434}\",",
" model=\"${7:llama3.2}\",",
" )",
")"
]
},
"Weaviate Starter Code - WCD": {
"prefix": "weaviate-starter-wcd",
"description": "Create a new Weaviate collection: WCD w/ Cohere",
"body": [
"import weaviate",
"from weaviate.classes.config import Configure, Property, DataType",
"from weaviate.classes.init import Auth",
"import os",
"",
"wcd_url = os.environ[\"WCD_DEMO_URL\"]",
"wcd_api_key = os.environ[\"WCD_DEMO_RO_KEY\"]",
"openai_api_key = os.environ[\"OPENAI_APIKEY\"]",
"cohere_api_key = os.environ[\"COHERE_APIKEY\"]",
"cohere_key = os.getenv(\"COHERE_APIKEY\")",
"weaviate_url = os.getenv(\"WEAVIATE_URL\")",
"weaviate_key = os.getenv(\"WEAVIATE_API_KEY\")",
"",
"client = weaviate.connect_to_weaviate_cloud(",
" cluster_url=wcd_url,",
" auth_credentials=Auth.api_key(wcd_api_key),",
" headers={",
" \"X-OpenAI-Api-Key\": openai_api_key,",
" \"X-Cohere-Api-Key\": cohere_api_key,",
" },",
" cluster_url=weaviate_url,",
" auth_credentials=Auth.api_key(weaviate_key),",
" headers={",
" \"X-Cohere-Api-Key\": cohere_key,",
" }",
")",
""
],
"description": "Connect to WCD edu demo instance"
"",
"collection_name = \"${1:TempCollection}\"",
"",
"client.collections.delete(collection_name)",
"",
"client.collections.create(",
" collection_name,",
" properties=[",
" Property(\"${2:title}\", DataType.TEXT),",
" Property(\"${3:body}\", DataType.TEXT),${4}",
" ],",
" vectorizer_config=[",
" Configure.NamedVectors.text2vec_cohere(",
" name=\"default\",",
" source_properties=[\"${2:title}\", \"${3:body}\"]",
" )",
" ],",
" generative_config=Configure.Generative.cohere()",
")"
]
},
"Code snippet section": {
"prefix": "code-section",
Expand Down
39 changes: 10 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@ first.
### Node.js Installation

Use the [nvm](https://github.com/nvm-sh/nvm) package manager to install Node.js.
The `nvm` project page provides an installation script.

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
```
The `nvm` project page provides an [installation script](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating).

After you install `nvm`, use `nvm` to install Node.js.

```
nvm install
```

By default, `nvm` installs the most recent version of Node.js. Install Node.js
19.9.0 as well. Version 19.9.0 is more compatible with the current
`weaviate.io` project dependencies.
By default, `nvm` installs the most recent version of Node.js. Also install the version of Node.js that is specified in `.github/workflows/pull_requests.yaml`. At the time of writing it is version 20.

```
nvm install 19.9.0
nvm use 19.9.0
nvm install 20
nvm use 20
```

### yarn Installation
Expand Down Expand Up @@ -105,7 +99,7 @@ the other project dependencies.
Switch to the project directory, then use yarn to update the dependencies.

```
cd weaviate.io
cd weaviate-io
yarn install
```

Expand All @@ -116,23 +110,10 @@ You may see some warnings during the installation.
When the installation completes, start the `yarn` server to test your build.

```
yarn start &
yarn start
```

`yarn` builds the project as a static web site and starts a server to host it.
`yarn` also opens a browser window connected to http://localhost:3000/ where
you can see your changes.

Most changes are reflected live without having to restart the server.

If you run ``yarn start`` in the foreground (without the "&"), you have to open
a second terminal to continue working on the command line. When you open a
second terminal, be sure to set the correct Node.js version before running
additional `yarn` commands.

```
nvm use node 19.9.0
```
This will build the site and start a local server, then open http://localhost:3000/ showing the local build. If you close the terminal, the server will stop. Or press `Ctrl+C`/`Cmd+C` to stop the server.

### Build the Web Site

Expand Down Expand Up @@ -178,7 +159,7 @@ If you are using GitHub pages for hosting, this command is a convenient way to b

Code examples in the documentation are in one of two formats:

#### New format
#### Extracted from scripts

In many files, you will see a format similar to:

Expand All @@ -204,7 +185,7 @@ import TSCode from '!!raw-loader!/_includes/code/howto/manage-data.create.ts';
text={TSCode}
startMarker="// ValidateObject START"
endMarker="// ValidateObject END"
language="ts"
language="tsv2"
/>
</TabItem>
</Tabs>
Expand All @@ -216,7 +197,7 @@ Here, the `FilteredTextBlock` component loads lines between the `startMarker` an

For more information about tests, please see [README-tests.md](./README-tests.md).

#### Legacy format
#### Pure text

In some code examples, the code will be written directly inside the `TabItem` component, as shown below.

Expand Down
5 changes: 5 additions & 0 deletions _build_scripts/slack-find-author.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
# A map of the github contributors that connects to @Slack handles
declare -A git_slack_map
git_slack_map=(
["Abdel Rodríguez"]="<@U03R5ELDHHB>"
["Andrzej Liszka"]="<@U036Y4GPB6W>"
["Bob van Luijt"]="<@U6P955HC4>"
["Charlie Harr"]="<@U044XTHRVFA>"
Expand All @@ -26,15 +27,19 @@ git_slack_map=(
["m-newhauser"]="<@U07K9AJCG2F>"
["Marcin Antas"]="<@U01E5BJ3UV7>"
["Mohamed Shahin"]="<@U05V4HPJ3M0>"
["Nate Wilkinson"]="<@U06SCMA8ZB9>"
["Parker Duckworth"]="<@U034QPLGSCU>"
["Peter Schramm"]="<@U03MWHJQ7PX>"
["Philip Vollet"]="<@U0573N5V97A>"
["Sebastian Witalec"]="<@U03DENV56CR>"
["Shan-Weaviate"]="<@U05DKAH2ZL1>"
["Spiros"]="<@U07G6HDV0HK>"
["Stefan Bogdan"]="<@U01DPKTVA93>"
["Svitlana"]="<@U03DQTXFDHS>"
["svitlana-sm"]="<@U03DQTXFDHS>"
["thomashacker"]="<@U056E1ZEM3L>"
["TuanaCelik"]="<@U07TUMJ1SUS>"
["Victoria Slocum"]="<@U05K0QFGRGV>"
["Wera"]="<@U043TKSEU5V>"
["Zain Hasan"]="<@U043TKSJQF9>"
["Mohamed Shahin"]="<@U05V4HPJ3M0>"
Expand Down
63 changes: 43 additions & 20 deletions _build_scripts/update-config-versions.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,53 @@
const fetch = require('node-fetch');

const getRepoVersion = async (repoName) => {
const response = await fetch( // fetch all release versions
`https://api.github.com/repos/weaviate/${repoName}/releases`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': // Use the github token if available
(process.env.GH_API_TOKEN) ?
`Bearer ${ process.env.GH_API_TOKEN }` : ''
try {
const response = await fetch( // fetch all release versions
`https://api.github.com/repos/weaviate/${repoName}/releases`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': // Use the github token if available
(process.env.GH_API_TOKEN) ?
`Bearer ${ process.env.GH_API_TOKEN }` : ''
}
}
);

// First check if the response was ok
if (!response.ok) {
throw new Error(`GitHub API error: ${response.status} ${response.statusText}`);
}
);

const releases = await response.json();
const highestVersion = releases
.filter(item => !item.prerelease) // remove pre-release items
.map(item => item.tag_name) // keep only the tag_name
.sort() // sort items alphabetically – ascending
.pop() // the last item contains the highest version (what we need)
.replace('v', '') // remove the v from the name "v1.26.1" => "1.26.1"
const releases = await response.json();

// Check if releases is actually an array
if (!Array.isArray(releases)) {
// Debug log to see what we're getting
console.log(`Raw response for ${repoName}:`, JSON.stringify(releases).slice(0, 200));
console.error(`Unexpected response format for ${repoName}:`, releases);
throw new Error(`Expected array of releases but got ${typeof releases}`);
}

if (releases.length === 0) {
throw new Error(`No releases found for ${repoName}`);
}

console.log(`${repoName} ${highestVersion}`)
const highestVersion = releases
.filter(item => !item.prerelease) // remove pre-release items
.map(item => item.tag_name) // keep only the tag_name
.sort() // sort items alphabetically – ascending
.pop() // the last item contains the highest version (what we need)
.replace('v', '') // remove the v from the name "v1.26.1" => "1.26.1"

return highestVersion;
console.log(`${repoName} ${highestVersion}`);
return highestVersion;
} catch (error) {
console.error(`Error fetching version for ${repoName}:`, error);
// Maybe return a default version or rethrow depending on your needs
throw error;
}
}

// Build time versions replace values set in versions-config.json
Expand Down Expand Up @@ -63,4 +86,4 @@ const updateConfigFile = async () => {
});
}

updateConfigFile();
updateConfigFile();
80 changes: 0 additions & 80 deletions _includes/ann-deep-96.mdx

This file was deleted.

Loading

0 comments on commit 35becdc

Please sign in to comment.