From ebd8f4396dad147a8e3dc21d6be55c66aef3156a Mon Sep 17 00:00:00 2001 From: Thomas Vitale Date: Mon, 22 Jan 2024 18:44:38 +0100 Subject: [PATCH] Improve documentation --- 01-chat-models/chat-models-ollama/README.md | 16 ++++++++++++++++ 01-chat-models/chat-models-openai/README.md | 8 +++++++- 02-prompts/prompts-basics-ollama/README.md | 16 ++++++++++++++++ 02-prompts/prompts-basics-openai/README.md | 8 +++++++- 02-prompts/prompts-messages-ollama/README.md | 16 ++++++++++++++++ 02-prompts/prompts-messages-openai/README.md | 8 +++++++- 02-prompts/prompts-templates-ollama/README.md | 16 ++++++++++++++++ 02-prompts/prompts-templates-openai/README.md | 8 +++++++- .../output-parsers-ollama/README.md | 16 ++++++++++++++++ .../output-parsers-openai/README.md | 8 +++++++- .../embedding-models-ollama/README.md | 16 ++++++++++++++++ .../embedding-models-openai/README.md | 8 +++++++- .../document-readers-json-ollama/README.md | 18 +++++++++++++++++- .../document-readers-text-ollama/README.md | 18 +++++++++++++++++- 14 files changed, 172 insertions(+), 8 deletions(-) diff --git a/01-chat-models/chat-models-ollama/README.md b/01-chat-models/chat-models-ollama/README.md index 4db2d8c..6ddccae 100644 --- a/01-chat-models/chat-models-ollama/README.md +++ b/01-chat-models/chat-models-ollama/README.md @@ -1,9 +1,25 @@ # Chat Models: Ollama +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` + ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http :8080/ai/chat ``` diff --git a/01-chat-models/chat-models-openai/README.md b/01-chat-models/chat-models-openai/README.md index be8abae..6b71470 100644 --- a/01-chat-models/chat-models-openai/README.md +++ b/01-chat-models/chat-models-openai/README.md @@ -1,13 +1,19 @@ # Chat Models: OpenAI +## Running the application + +### When using OpenAI + ```shell export SPRING_AI_OPENAI_API_KEY= ``` ```shell -./gradlew bootTestRun +./gradlew bootRun ``` +## Calling the application + ```shell http :8080/ai/chat ``` diff --git a/02-prompts/prompts-basics-ollama/README.md b/02-prompts/prompts-basics-ollama/README.md index a9a94df..3ca38ac 100644 --- a/02-prompts/prompts-basics-ollama/README.md +++ b/02-prompts/prompts-basics-ollama/README.md @@ -1,9 +1,25 @@ # Prompts Basic: Ollama +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` + ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http --raw "What is the capital of Italy?" :8080/ai/chat/simple ``` diff --git a/02-prompts/prompts-basics-openai/README.md b/02-prompts/prompts-basics-openai/README.md index cc9771b..6260431 100644 --- a/02-prompts/prompts-basics-openai/README.md +++ b/02-prompts/prompts-basics-openai/README.md @@ -1,13 +1,19 @@ # Prompts Basic: OpenAI +## Running the application + +### When using OpenAI + ```shell export SPRING_AI_OPENAI_API_KEY= ``` ```shell -./gradlew bootTestRun +./gradlew bootRun ``` +## Calling the application + ```shell http --raw "What is the capital of Italy?" :8080/ai/chat/simple ``` diff --git a/02-prompts/prompts-messages-ollama/README.md b/02-prompts/prompts-messages-ollama/README.md index 1e41e4e..e29af4e 100644 --- a/02-prompts/prompts-messages-ollama/README.md +++ b/02-prompts/prompts-messages-ollama/README.md @@ -1,9 +1,25 @@ # Prompts Messages: Ollama +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` + ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http --raw "What is the capital of Italy?" :8080/ai/chat/single ``` diff --git a/02-prompts/prompts-messages-openai/README.md b/02-prompts/prompts-messages-openai/README.md index ec6e833..0c4f6c6 100644 --- a/02-prompts/prompts-messages-openai/README.md +++ b/02-prompts/prompts-messages-openai/README.md @@ -1,13 +1,19 @@ # Prompts Messages: OpenAI +## Running the application + +### When using OpenAI + ```shell export SPRING_AI_OPENAI_API_KEY= ``` ```shell -./gradlew bootTestRun +./gradlew bootRun ``` +## Calling the application + ```shell http --raw "What is the capital of Italy?" :8080/ai/chat/single ``` diff --git a/02-prompts/prompts-templates-ollama/README.md b/02-prompts/prompts-templates-ollama/README.md index 73e9b89..acade2c 100644 --- a/02-prompts/prompts-templates-ollama/README.md +++ b/02-prompts/prompts-templates-ollama/README.md @@ -1,9 +1,25 @@ # Prompts Templates: Ollama +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` + ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http :8080/ai/chat/user genre="rock" instrument="piano" ``` diff --git a/02-prompts/prompts-templates-openai/README.md b/02-prompts/prompts-templates-openai/README.md index 2b73966..5b0a594 100644 --- a/02-prompts/prompts-templates-openai/README.md +++ b/02-prompts/prompts-templates-openai/README.md @@ -1,13 +1,19 @@ # Prompts Templates: OpenAI +## Running the application + +### When using OpenAI + ```shell export SPRING_AI_OPENAI_API_KEY= ``` ```shell -./gradlew bootTestRun +./gradlew bootRun ``` +## Calling the application + ```shell http :8080/ai/chat/user genre="rock" instrument="piano" ``` diff --git a/03-output-parsers/output-parsers-ollama/README.md b/03-output-parsers/output-parsers-ollama/README.md index d0f227f..2ed15d7 100644 --- a/03-output-parsers/output-parsers-ollama/README.md +++ b/03-output-parsers/output-parsers-ollama/README.md @@ -1,9 +1,25 @@ # Output Parsers: Ollama +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` + ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http :8080/ai/chat/bean genre="rock" instrument="piano" ``` diff --git a/03-output-parsers/output-parsers-openai/README.md b/03-output-parsers/output-parsers-openai/README.md index b269735..542fdb7 100644 --- a/03-output-parsers/output-parsers-openai/README.md +++ b/03-output-parsers/output-parsers-openai/README.md @@ -1,13 +1,19 @@ # Output Parsers: OpenAI +## Running the application + +### When using OpenAI + ```shell export SPRING_AI_OPENAI_API_KEY= ``` ```shell -./gradlew bootTestRun +./gradlew bootRun ``` +## Calling the application + ```shell http :8080/ai/chat/bean genre="rock" instrument="piano" ``` diff --git a/04-embedding-models/embedding-models-ollama/README.md b/04-embedding-models/embedding-models-ollama/README.md index 042a1ba..12c00d9 100644 --- a/04-embedding-models/embedding-models-ollama/README.md +++ b/04-embedding-models/embedding-models-ollama/README.md @@ -1,9 +1,25 @@ # Embedding Models: Ollama +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` + ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http :8080/ai/embed ``` diff --git a/04-embedding-models/embedding-models-openai/README.md b/04-embedding-models/embedding-models-openai/README.md index 7703155..d6ef745 100644 --- a/04-embedding-models/embedding-models-openai/README.md +++ b/04-embedding-models/embedding-models-openai/README.md @@ -1,13 +1,19 @@ # Embedding Models: OpenAI +## Running the application + +### When using OpenAI + ```shell export SPRING_AI_OPENAI_API_KEY= ``` ```shell -./gradlew bootTestRun +./gradlew bootRun ``` +## Calling the application + ```shell http :8080/ai/embed ``` diff --git a/05-document-readers/document-readers-json-ollama/README.md b/05-document-readers/document-readers-json-ollama/README.md index d45c5dd..b511c24 100644 --- a/05-document-readers/document-readers-json-ollama/README.md +++ b/05-document-readers/document-readers-json-ollama/README.md @@ -1,9 +1,25 @@ -# Embedding Models: Ollama +# JSON Document Readers: Ollama + +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http --raw "What bike is good for city commuting?" :8080/ai/doc/chat ``` diff --git a/05-document-readers/document-readers-text-ollama/README.md b/05-document-readers/document-readers-text-ollama/README.md index 73af1c0..51e7006 100644 --- a/05-document-readers/document-readers-text-ollama/README.md +++ b/05-document-readers/document-readers-text-ollama/README.md @@ -1,9 +1,25 @@ -# Embedding Models: Ollama +# Text Document Readers: Ollama + +## Running the application + +### When using Ollama + +```shell +ollama run llama2 +``` ```shell ./gradlew bootTestRun ``` +### When using Docker/Podman + +```shell +./gradlew bootTestRun +``` + +## Calling the application + ```shell http --raw "What is Iorek's biggest dream?" :8080/ai/doc/chat ```