You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: polyglot-chat-app/README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Polyglot Chat Application
2
2
3
-
This example demonstrates how to integrate Python on GraalVM with a Micronaut application.
4
-
The application uses the nltk module to analyze text sentiment.
5
-
The application uses the Gradle build tool.
3
+
This example demonstrates how to integrate Python in a Micronaut Java application using the Gradle build tool.
4
+
The application uses the [Natural Language Toolkit (nltk)](https://www.nltk.org/) module to analyze the sentiment of user input.
5
+
The example also shows how to create a native executable from the application using GraalVM.
6
6
7
7
## Preparation
8
8
@@ -14,11 +14,11 @@ The application uses the Gradle build tool.
14
14
cd graalvm-demos/polyglot-chat-app
15
15
```
16
16
17
-
2. Download and install the latest GraalPy as described in the [Getting Started guide](https://www.graalvm.org/latest/reference-manual/python/#installing-graalpy). For example on Linux:
17
+
2. Download and install the latest GraalPy as described in the [Getting Started guide](https://www.graalvm.org/latest/reference-manual/python/#installing-graalpy). For example:
18
18
```bash
19
19
pyenv install graalpy-23.1.2
20
20
pyenv shell graalpy-23.1.2
21
-
``
21
+
```
22
22
23
23
3. Create a virtual environment forthe demoin the _resources_ directory, activate it, install the required package, and download a lexicon:
24
24
```bash
@@ -34,8 +34,8 @@ The application uses the Gradle build tool.
4. (Optional) [Download and install GraalVM JDK for Java 21](https://www.graalvm.org/downloads/) or later to run Python with runtime compilation and to build a native image.
38
-
The demo will work with any OpenJDK distribution, but will be much faster on GraalVM JDK.
37
+
4. The demo will work with any OpenJDK distribution, but will be much faster on [GraalVM JDK for Java 21](https://www.graalvm.org/downloads/).
38
+
39
39
40
40
## Building and Running the Application
41
41
@@ -54,12 +54,12 @@ The demo will work with any OpenJDK distribution, but will be much faster on Gra
54
54
```
55
55
[bob 😀] awesome, GraalVM and GraalPy rock!
56
56
[bob 🫥] are we done yet?
57
-
[bob 💬] still loading the sentiment model I believe
57
+
[bob 💬] Joined!
58
58
```
59
59
60
60
## (Optional) Building a Native Executable
61
61
62
-
> Note: this requires [Download and install GraalVM JDK for Java 21](https://www.graalvm.org/downloads/) or later.
62
+
> Note: this requires [GraalVM JDK for Java 21](https://www.graalvm.org/downloads/) or later.
63
63
64
64
The application can be compiled ahead-of-time to a native executable using GraalVM Native Image.
65
65
The Python code must be copied to the _build/_ directory that is kept next to the native executable.
0 commit comments