Skip to content

Commit

Permalink
[Draft] TS Client Migration Docs and Client Page updates. (#1933)
Browse files Browse the repository at this point in the history
* added migration page

* first shot at cleint page

* fixed a broken link

* added migration page

* made changes

* final client page

* cleaned code examples

* TSv3 content changes (#1992)

* TSv3 client content pages

* Intro

* Spelling

* Landing page, feedback

* landing page

* finish copy from 1967

* 1976 in progress

* finish copy from 1976

* staging index

* v2 v3

* v3 staging

* intro

* interact

* staging

* push

* fixed merge issues

* DR-291 TSv3 branch consolidation (#1995)

* DR-291 TSv3 branch consolidation

* titles

* ts config

* node support

* async

* v3 client pr 1967

* migrate pr1967

* rt nav

* connect

* ts client staging

* migrate staging

* Add link

* Beta note

---------

Co-authored-by: daveatweaviate <[email protected]>



------
From yarn verify-links

🏊‍♂️ crawling ./build.dev
🤖 Successfully scanned 0 links in 0.005 seconds.
**************************************
Link Verification Complete
  • Loading branch information
malgamves authored Apr 26, 2024
1 parent 4e8c786 commit 88dd109
Show file tree
Hide file tree
Showing 19 changed files with 1,114 additions and 762 deletions.
7 changes: 4 additions & 3 deletions _includes/clients/matrix-intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
These charts show the Weaviate client releases associated with Weaviate core releases.
These charts show the Weaviate client releases associated with Weaviate core releases.

### Current minor releases

### Current Weaviate core minor releases

|Weaviate Version|Release Date|Python|TypeScript|Go|Java|
|:-|:-|:-:|:-:|:-:|:-:|
Expand All @@ -15,7 +16,7 @@ These charts show the Weaviate client releases associated with Weaviate core rel
| [1.24.2](https://github.com/weaviate/weaviate/releases/tag/v1.24.2) | 2024-03-13 | '' | '' | '' | '' |
| [1.24.1](https://github.com/weaviate/weaviate/releases/tag/v1.24.1) | 2024-03-01 | 4.5.0 | 2.1.0 | 4.12.0 | 4.5.1 |

### Major releases
### Weaviate core major releases

|Weaviate Version|Release Date|Python|TypeScript|Go|Java|
|:-|:-|:-:|:-:|:-:|:-:|
Expand Down
5 changes: 5 additions & 0 deletions _includes/clients/ts-client-close.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The client uses a keep-alive header to maintain long-lived connections to Weaviate.

After you establish the connection to your Weaviate instance, subsequent calls are faster. When you finish your client operations, close the connection to free server resources.

Use the `client.close()` method to close the connection instead of waiting for the connection to time out.
3 changes: 3 additions & 0 deletions _includes/clients/ts-client-intro.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The Weaviate TypeScript client supports TypeScript and JavaScript. The TypeScript client v3 is currently in beta.

The upcoming v3 client currently supports server side development (Node.js hosted). See [v3 packages](/developers/weaviate/client-libraries/typescript/v2_v3_migration#node-support-only) for details. If your application is browser based, consider using the TypeScript client v2.
6 changes: 3 additions & 3 deletions _includes/docs-feedback.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Questions and feedback

If you have any questions or feedback, please let us know [on our forum](https://forum.weaviate.io/). For example, you can:
If you have any questions or feedback, let us know in our [user forum](https://forum.weaviate.io/).

- [Provide feedback on the documentation](https://forum.weaviate.io/new-topic?title=%5BDocs%5D%20YOUR%20TOPIC&body=Details%20here&category=support&tags=documentation)
- [Ask a technical question](https://forum.weaviate.io/new-topic?title=%5BQuestion%5D%20YOUR%20TOPIC&body=Details%20here&category=support&tags=technical)
- [Technical questions](https://forum.weaviate.io/new-topic?title=%5BQuestion%5D%20YOUR%20TOPIC&body=Details%20here&category=support&tags=technical)
- [Documentation feedback](https://forum.weaviate.io/new-topic?title=%5BDocs%5D%20YOUR%20TOPIC&body=Details%20here&category=support&tags=documentation)
6 changes: 3 additions & 3 deletions blog/2024-01-23-typescript-multimodal-search/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ date: 2024-01-24
image: ./img/hero.png
tags: ['concepts', 'how-to', 'search']
# tags: ['multimodal-search'] # Added for further SEO without changing the original tags
description: "We look at how to build Multimodal applications in Typescript and dive into everything that needs to happen in between."
description: "We look at how to build Multimodal applications in TypeScript and dive into everything that needs to happen in between."

---

![Cover, Building Multimodal AI in TypeScript](./img/hero.png)


For a lot of people, Multimodal AI and its derivatives are strong contenders for technology of the year. The promises of Multimodal applications of artificial intelligence are exciting and speak to behavioural changes in media consumption and general interaction with the internet. I'm here to show you how you can get a piece of the pie. In this article, we’ll look at how to build Multimodal applications in Typescript and dive into everything that needs to happen in between.
For a lot of people, Multimodal AI and its derivatives are strong contenders for technology of the year. The promises of Multimodal applications of artificial intelligence are exciting and speak to behavioural changes in media consumption and general interaction with the internet. I'm here to show you how you can get a piece of the pie. In this article, we’ll look at how to build Multimodal applications in TypeScript and dive into everything that needs to happen in between.



Expand Down Expand Up @@ -602,7 +602,7 @@ Then you should be able to search like this

## Conclusion

We just saw how to leverage a Multimodal AI model to power our Multimodal search in Typescript with Next.js. A lot is happening in the space and this only just scratches the surface of Multimodal use cases. One could take this a step further and enable search via image, video or audio uploads. Another avenue worth exploring is Generative Multimodal models to either enhance results or interact with existing datasets. If this is something you find interesting or would love to continue a conversation on, find me online at [malgamves](https://malgamves.dev).
We just saw how to leverage a Multimodal AI model to power our Multimodal search in TypeScript with Next.js. A lot is happening in the space and this only just scratches the surface of Multimodal use cases. One could take this a step further and enable search via image, video or audio uploads. Another avenue worth exploring is Generative Multimodal models to either enhance results or interact with existing datasets. If this is something you find interesting or would love to continue a conversation on, find me online at [malgamves](https://malgamves.dev).


import WhatNext from '/_includes/what-next.mdx'
Expand Down
28 changes: 14 additions & 14 deletions blog/2024-03-20-typescript-client-beta/index.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Announcing the Weaviate Typescript Client Beta
title: Announcing the Weaviate TypeScript Client Beta
slug: typescript-client-beta
authors: [daniel, tommy]
date: 2024-03-21
tags: ['engineering','release']
image: ./img/hero.png
description: "A beta release of our new Typescript client is now available! Help us make it better by trying it out and providing your feedback."
description: "A beta release of our new TypeScript client is now available! Help us make it better by trying it out and providing your feedback."
---

![The pre-release Weaviate Typescript client](./img/hero.png)
![The pre-release Weaviate TypeScript client](./img/hero.png)

:::info TL;DR

We've released a beta version of our new Typescript client. It's available for you to try out [on npm](https://www.npmjs.com/package/weaviate-client) under the new name: `weaviate-client`. We’d also love any feedback you can share on the client and your experience using it. Please open an issue on the [client GitHub repository](https://github.com/weaviate/typescript-client/tree/collections/main). Besides the package name change, we’ve made a lot of changes that mirror our client refresh in Python to bring the two closer to each other. We have better Typescript support, a collections-first approach, and performance improvements.
We've released a beta version of our new TypeScript client. It's available for you to try out [on npm](https://www.npmjs.com/package/weaviate-client) under the new name: `weaviate-client`. We’d also love any feedback you can share on the client and your experience using it. Please open an issue on the [client GitHub repository](https://github.com/weaviate/typescript-client/tree/collections/main). Besides the package name change, we’ve made a lot of changes that mirror our client refresh in Python to bring the two closer to each other. We have better TypeScript support, a collections-first approach, and performance improvements.

<br/>

Expand All @@ -22,9 +22,9 @@ You can try it here - [Experimental clients](/developers/weaviate/client-librari

## Introduction

With first-hand developer experience in mind, we’re committed to making sure that the client libraries we provide are true to the optimum developer experience of each community. We got a lot of feedback on things we could do better in our Typescript client and we’re thrilled to share this beta version with you.
With first-hand developer experience in mind, we’re committed to making sure that the client libraries we provide are true to the optimum developer experience of each community. We got a lot of feedback on things we could do better in our TypeScript client and we’re thrilled to share this beta version with you.

We recently released an update to our [Python client](https://weaviate.io/blog/collections-python-client-preview). With Typescript being the second most popular language choice for developers we felt it only fair to bring the enhancements from the Python client to the Typescript ecosystem.
We recently released an update to our [Python client](https://weaviate.io/blog/collections-python-client-preview). With TypeScript being the second most popular language choice for developers we felt it only fair to bring the enhancements from the Python client to the TypeScript ecosystem.

We shared a few messages and have tested the client internally and we’re finally ready to have the wider community try out the new client and the API it offers.

Expand All @@ -38,15 +38,15 @@ npm install weaviate-client --tag beta # Or yarn add weaviate-client@beta
Using the beta tag is the best way to ensure you're using the latest version of the client.

:::info Your tsconfig.json file
If you’re using Typescript, your tsconfig.json file must be specified with (at least) `"module": "Node16"` and `"moduleResolution": "Node16"`.
If you’re using TypeScript, your tsconfig.json file must be specified with (at least) `"module": "Node16"` and `"moduleResolution": "Node16"`.
:::

You might be curious to know what a query looks like in the new client, let's answer that for you.

A `nearText` query looks like this in the previous Typescript client.
A `nearText` query looks like this in the previous TypeScript client.

```typescript
// nearText in v2 Typescript Client
// nearText in v2 TypeScript Client
result = await client.graphql
.get()
.withClassName('JeopardyQuestion')
Expand All @@ -57,11 +57,11 @@ result = await client.graphql

```

In the new Typescript client beta, the `nearText` you've grown to love becomes:
In the new TypeScript client beta, the `nearText` you've grown to love becomes:


```typescript
// nearText in v3 Typescript Client
// nearText in v3 TypeScript Client
const myCollection = client.collections.get('JeopardyQuestion');

const result = await myCollection.query.nearText(['animals in movies'],{
Expand All @@ -73,7 +73,7 @@ const result = await myCollection.query.nearText(['animals in movies'],{



:::info Try the new Typescript client
:::info Try the new TypeScript client
If you're keen to try it, please head over to our [Experimental clients](/developers/weaviate/client-libraries/typescript) page. There, you'll find the installation, usage, and feedback instructions.
:::

Expand All @@ -100,7 +100,7 @@ Let's look at each of these in more detail.

### Better Type Support

As with previous clients, we're enabling both Javascript and Typescript Developers with this client. Written in Typescript you have the benefits of strong typing out of the box. However, we have method types available for Javascript developers as well. This makes for a better more intuitive experience in your IDE and beyond. This means you do not have to remember the exact API parameter names, as the IDE will show you the available options. This can be a hurdle when you are working with less often-used options, trying new APIs, or when you are new to Weaviate.
As with previous clients, we're enabling both JavaScript and TypeScript Developers with this client. Written in TypeScript you have the benefits of strong typing out of the box. However, we have method types available for JavaScript developers as well. This makes for a better more intuitive experience in your IDE and beyond. This means you do not have to remember the exact API parameter names, as the IDE will show you the available options. This can be a hurdle when you are working with less often-used options, trying new APIs, or when you are new to Weaviate.

import codeCompletionImgUrl from './img/code-completion.gif';

Expand Down Expand Up @@ -172,7 +172,7 @@ This means that you will no longer need to specify the collection name in every

For example, take the following syntax for performing a simple request to retrieve a few objects from the database:

:::note Classic Typescript syntax
:::note Classic TypeScript syntax

```typescript
const response = await client.graphql
Expand Down
14 changes: 7 additions & 7 deletions blog/2024-03-28-hybrid-search-typescript/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ authors: [daniel, ajit]
date: 2024-04-09
tags: ['concepts', 'how-to', 'search', 'javascript']
image: ./img/hero.png
description: 'Hybrid Search for curious Web Developers with the new Weaviate Typescript client and Next.js'
description: 'Hybrid Search for curious Web Developers with the new Weaviate TypeScript client and Next.js'
---

![A Web Developers Guide to Hybrid Search Cover](./img/hero.png)

:::info

This tutorial is built with Next.js and Weaviate. It uses a beta version of the v3 Typescript Client. Find out more about the new client here - [Experimental clients](/developers/weaviate/client-libraries/typescript/typescript-v3).
This tutorial is built with Next.js and Weaviate. It uses a beta version of the v3 TypeScript Client. Find out more about the new client here - [Experimental clients](/developers/weaviate/client-libraries/typescript/typescript-v3).

:::

Expand All @@ -39,7 +39,7 @@ Keyword search finds objects with an exact match between the terms in the query

Hybrid search in Weaviate combines keyword (BM25) and vector search to leverage both exact term matching and semantic context. With either the `rankedFusion` or `relativeScoreFusion` fusion algorithms, we merge the results from both keyword search and the vector search.

A code snippet of hybrid search in Javascript will look something like this.
A code snippet of hybrid search in JavaScript will look something like this.

```typescript
const myCollection = client.collections.get('JeopardyQuestion');
Expand All @@ -60,7 +60,7 @@ With Weaviates hybrid search, we have two ways to adjust the hybrid search algor

Think of alpha as a measure of how much your hybrid search should lean towards either vector search or keyword search where an alpha of 1 is a pure vector search, and an alpha of 0 is a pure keyword search. It is 0.75 by default.

The code snippet below demonstrates how to change the alpha of your hybrid search in Javascript.
The code snippet below demonstrates how to change the alpha of your hybrid search in JavaScript.

```typescript
const myCollection = client.collections.get('JeopardyQuestion');
Expand Down Expand Up @@ -90,7 +90,7 @@ In a nutshell, **Ranked Fusion** (the original hybrid search algorithm in Weavia

![Reciprocal Score Fusion Algorithm](./img/relative-score.png)

The code snippet below demonstrates how to change the ranking algorithm of your hybrid search in Javascript.
The code snippet below demonstrates how to change the ranking algorithm of your hybrid search in JavaScript.

```typescript
const myCollection = client.collections.get('JeopardyQuestion');
Expand All @@ -116,7 +116,7 @@ If your use cases don't fall into any of the two scenarios mentioned, you might

## Building an Application that leverages Hybrid Search

To get some hands-on experience with the new Typescript client, let's create a simple web application that allows us to perform hybrid search on a collection of quotes. If you have ever wanted to strengthen your point by quoting someone famous, this is the project for you!
To get some hands-on experience with the new TypeScript client, let's create a simple web application that allows us to perform hybrid search on a collection of quotes. If you have ever wanted to strengthen your point by quoting someone famous, this is the project for you!

### Setting up WCS (Weaviate Cloud Services)

Expand Down Expand Up @@ -326,7 +326,7 @@ The project on Github should look like this once cloned and started.

## Conclusion

That's everything that's needed for creating a full-stack app using Weaviate and the new Typescript client! The best way to get even more familiar with the involved tooling is to extend your QuoteFinder. Whether you'd like to add pure vector search, improve the frontend, or even implement the functionality to search through your quotes using images, the possibilities are endless!
That's everything that's needed for creating a full-stack app using Weaviate and the new TypeScript client! The best way to get even more familiar with the involved tooling is to extend your QuoteFinder. Whether you'd like to add pure vector search, improve the frontend, or even implement the functionality to search through your quotes using images, the possibilities are endless!

import WhatsNext from '/_includes/what-next.mdx';

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
To authenticate against Weaviate using an API key, instantiate the client as follows:
If you use an API key to authenticate, instantiate the client like this:
1 change: 0 additions & 1 deletion developers/weaviate/client-libraries/python/python_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ image: og/docs/client-libraries.jpg
# tags: ['python', 'client library']
---


:::note Python client version
The current Python client version is `v||site.python_client_version||`
:::
Expand Down
Loading

0 comments on commit 88dd109

Please sign in to comment.