Docs update, WIP
This commit is contained in:
101
README.md
101
README.md
@@ -9,13 +9,17 @@ Let's make your `@Beans` intelligent!
|
||||
|
||||
## Project Links
|
||||
|
||||
* [Issues](https://github.com/spring-projects-experimental/spring-ai/issues)
|
||||
* [Documentation](https://docs.spring.io/spring-ai/reference/)
|
||||
* [Issues](https://github.com/spring-projects-experimental/spring-ai/issues)
|
||||
* [Discussions](https://github.com/spring-projects-experimental/spring-ai/discussions)
|
||||
* [JavaDocs](https://docs.spring.io/spring-ai/docs/current-SNAPSHOT/)
|
||||
|
||||
## Dependencies
|
||||
|
||||
Check out the workshop below but if you want to add the necessary goodies by hand, you will need to add the snapshot repository
|
||||
The Spring AI project provides artifacts in the Spring Milestone Repository.
|
||||
You will need to add configuration to add a reference to the Spring Milestone repository in your build file.
|
||||
For example, in maven, add the following repository definition.
|
||||
|
||||
|
||||
```xml
|
||||
<repositories>
|
||||
@@ -84,40 +88,87 @@ These Python libraries share foundational themes with Spring projects, such as:
|
||||
|
||||
Taking inspiration from these libraries, the Spring AI project aims to provide a similar experience for Spring developers in the AI domain.
|
||||
|
||||
Note, that the Spring AI API is not a direct port of either LangChain or LlamaIndex. You will see significant differences in the API if you are familiar with those two projects, though concepts and ideas are fairly portable.
|
||||
|
||||
## Feature Overview
|
||||
|
||||
The following is a feature list resembling those found in the LangChain documentation.
|
||||
The initial features lay the foundation, with subsequent, more complex features building upon them.
|
||||
This is a high level feature overview.
|
||||
The features that are implemented lay the foundation, with subsequent more complex features building upon them.
|
||||
|
||||
You can find more details in the [Reference Documentation](https://docs.spring.io/spring-ai/reference/)
|
||||
|
||||
Not all features listed here are implemented yet, but a good amount are :)
|
||||
### Interacting with AI Models
|
||||
|
||||
**AI Client:** A foundational feature of Spring AI is a standardized client API for interfacing with generative AI models. With this common API, you can initially target g [OpenAI's Chat endpoint](https://platform.openai.com/docs/api-reference/chat) and easily swap about the implementation to use other platforms, such as [HuggingFace's Inference Endpoints](https://huggingface.co/inference-endpoints)
|
||||
|
||||
Dive deeper into [Models](https://docs.spring.io/spring-ai/reference/concepts.html#_models). in our concept guide.
|
||||
For usage details, consult the [AiClient API guide](https://docs.spring.io/spring-ai/reference/api/aiclient.html)
|
||||
|
||||
|
||||
### Model I/O
|
||||
**Prompts:** Central to AI model interaction is the Prompt, which provides specific instructions for the AI to act upon.
|
||||
Crafting an effective Prompt is both an art and science, giving rist to the discipline of "Prompt Engineering".
|
||||
These prompts often leverage a templating engine for easy data substitution within predefined text using placeholders.
|
||||
|
||||
**AI Models:** A foundational feature is a common client API for interacting with generative AI Models.
|
||||
A common API enables you to develop an application targeting OpenAI's ChatGPT HTTP interface and easily switch to Azure's OpenAI service, as an example.
|
||||
Explore more on [Prompts](https://docs.spring.io/spring-ai/reference/concepts.html#_prompts) in our concept guide.
|
||||
To learn about the Prompt class, refer to the [Prompt API guide](https://docs.spring.io/spring-ai/reference/api/prompt.html).
|
||||
|
||||
**Prompts:** At the center of the AI model interaction is the Prompt - a set of instructions for the AI model to respond to.
|
||||
Creating an effective Prompt is part art and part science, giving rise to the discipline of Prompt Engineering.
|
||||
Prompts utilize a templating engine, enabling easy replacement of data within prompt text placeholders.
|
||||
**Prompt Templates:** Prompt Templates support the creation of prompts, particularly when a Template Engine is employed.
|
||||
|
||||
**Output Parsers:** The AI responses are typically a raw `java.lang.String`. Output Parsers transform the raw String into structured formats like CSV or JSON, to make the output usable in a programming environment.
|
||||
Output Parsers may also do additional post-processing on the response String.
|
||||
Delve into PromptTemplates in our [concept guide](https://docs.spring.io/spring-ai/reference/concepts.html#_prompt_templates).
|
||||
For a hands-on guide to PromptTemplate, see the [PromptTemplate API guide](https://docs.spring.io/spring-ai/reference/api/prompt-template.html).
|
||||
|
||||
**Output Parsers:** AI model outputs often come as raw `java.lang.String` values. Output Parsers restructure these raw strings into more programmer-friendly formats, such as CSV or JSON.
|
||||
|
||||
Get insights on Output Parsers in our [concept guide](https://docs.spring.io/spring-ai/reference/concepts.html#_output_parsing)..
|
||||
For implementation details, visit the [OutputParser API guide](https://docs.spring.io/spring-ai/reference/api/output-parser.html).
|
||||
|
||||
### Incorporating your data
|
||||
|
||||
**Data Management:** A significant innovation in Generative AI involves enabling the model to understand your proprietary data without having to retrain the model's weights. Retraining a model is a complex and compute-intensive task.
|
||||
Recent Generative AI models have billions of parameters that require specialized hard-to-find hardware making it practically impossible to retrain the largest of models.
|
||||
Instead, the 'In-context' learning technique lets you more easily incorporate your data into the pre-trained model.
|
||||
This data can be from text files, HTML, database results, etc.
|
||||
Effectively incorporating your data in an AI model requires specific techniques critical for developing successful solutions.
|
||||
Incorporating proprietary data into Generative AI without retraining the model has been a breakthrough.
|
||||
Retraining models, especially those with billions of parameters, is challenging due to the specialized hardware required.
|
||||
The 'In-context' learning technique provides a simpler method to infuse your pre-trained model with data, whether from text files, HTML, or database results.
|
||||
The right techniques are critical for developing successful solutions.
|
||||
|
||||
**Vector Stores:** A widely used technique to incorporate your data in an AI model is using Vector Databases.
|
||||
Vector Databases help to classify which part of your documents are most relevant for the AI model to use in creating a response.
|
||||
Examples of Vector Databases are Chroma, Pinecone, Weaviate, Mongo Atlas, and RediSearch.
|
||||
Spring IO abstracts these databases, allowing easy swapping of implementations.
|
||||
|
||||
#### Retrieval Augmented Generation
|
||||
|
||||
Retrieval Augmented Generation, or RAG for short, is a pattern that enables you to bring your data to pre-trained models.
|
||||
RAG excels in the 'query over your docs' use-case.
|
||||
|
||||
Learn more about [Retrieval Augmented Generation](https://docs.spring.io/spring-ai/reference/concepts.html#_retrieval_augmented_generation).
|
||||
|
||||
Bringing your data to the model follows an Extract, Transform, and Load (ETL) pattern.
|
||||
The subsequent classes and interfaces support RAG's data preparation.
|
||||
|
||||
**Documents:**
|
||||
|
||||
The `Document` class encapsulates your data, including text and metadata, for the AI model.
|
||||
While a Document can represent extensive content, such as an entire file, the RAG approach
|
||||
segments content into smaller pieces for inclusion in the prompt.
|
||||
The ETL process uses the interfaces `DocumentReader`, `DocumentTransformer`, and `DocumentWriter`, ending with data storage in a Vector Database.
|
||||
This database later discerns the pieces of data that are pertinent to a user's query.
|
||||
|
||||
|
||||
**Document Readers:**
|
||||
|
||||
Document Readers produce a `List<Document>` from diverse sources like PDFs, Markdown files, and Word documents.
|
||||
Given that many sources are unstructured, Document Readers often segment based on content semantics, avoiding splits within tables or code sections.
|
||||
After the initial creation of the `List<Document>`, the data flows through transformers for further refinement.
|
||||
|
||||
**Document Transformers:**
|
||||
|
||||
Transformers further modify the `List<Document>` by eliminating superfluous data, like PDF margins, or appending metadata (e.g., primary keywords or summaries).
|
||||
Another critical transformation is subdividing documents to fit within the AI model's token constraints.
|
||||
Each model has a context-window indicating its input and output data limits. Typically, one token equates to about 0.75 words. For instance, in model names like gpt-4-32k, "32K" signifies the token count.
|
||||
|
||||
**Document Writers:**
|
||||
|
||||
The final ETL step within RAG involves committing the data segments to a Vector Database.
|
||||
Though the `DocumentWriter` interface isn't exclusively for Vector Database writing, it the main type of implementation.
|
||||
|
||||
**Vector Stores:** Vector Databases are instrumental in incorporating your data with AI models.
|
||||
They ascertain which document sections the AI should use for generating responses.
|
||||
Examples of Vector Databases include Chroma, Postgres, Pinecone, Weaviate, Mongo Atlas, and Redis. Spring AI's `VectorStore` abstraction permits effortless transitions between database implementations.
|
||||
|
||||
### Chaining together multiple AI model interactions
|
||||
|
||||
@@ -126,11 +177,15 @@ Spring IO abstracts these databases, allowing easy swapping of implementations.
|
||||
While you can create custom Chains tailored to your specific use case, pre-configured use-case-specific Chains are provided to accelerate your development.
|
||||
Use cases such as Question-Answering, Text Generation, and Summarization are examples.
|
||||
|
||||
* This is currently a work in progress.
|
||||
|
||||
### Memory
|
||||
|
||||
**Memory:** To support multiple AI model interactions, your application must recall the previous inputs and outputs.
|
||||
A variety of algorithms are available for different scenarios, often backed by databases like Redis, Cassandra, MongoDB, Postgres, and other database technologies.
|
||||
|
||||
* This is currently a work in progress
|
||||
|
||||
### Agents
|
||||
|
||||
Beyond Chains, Agents represent the next level of sophistication.
|
||||
@@ -138,7 +193,7 @@ Agents use the AI models themselves to determine the techniques and steps to res
|
||||
Agents might even dynamically access external data sources to retrieve information necessary for responding to a user.
|
||||
It's getting a bit funky, isn't it?
|
||||
|
||||
|
||||
* This is currently a work in progress
|
||||
|
||||
## Building
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
* xref:concepts.adoc[AI Concepts]
|
||||
* xref:getting-started.adoc[Getting Started]
|
||||
* xref:api/index.adoc[]
|
||||
** xref:api/aiclient.adoc[]
|
||||
** xref:api/models.adoc[]
|
||||
** xref:api/prompt.adoc[]
|
||||
** xref:api/prompt-template.adoc[]
|
||||
** xref:api/output-parser.adoc[]
|
||||
** xref:api/chains.adoc[]
|
||||
** xref:api/dataloaders.adoc[]
|
||||
** xref:api/documentreaders.adoc[]
|
||||
** xref:api/splitters.adoc[]
|
||||
** xref:api/embeddings.adoc[]
|
||||
** xref:api/vectordbs.adoc[]
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
= AiClient
|
||||
|
||||
The interface `AiClient` is the main interface to interacting with an AI Model.
|
||||
|
||||
```java
|
||||
public interface AiClient {
|
||||
|
||||
default String generate(String message) {
|
||||
// implementation omitted
|
||||
}
|
||||
|
||||
AiResponse generate(Prompt prompt);
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
The `AiClient` provides portability to interact with AI Models that have different APIs.
|
||||
As one would expect in Spring, there are multiple implementations of a common interface so that you can more easily switch AI Models without making large amounts of code changes.
|
||||
|
||||
To obtain an implementation of the `AiClient` interface, use one of the Spring Boot Starters in your build file.
|
||||
For Maven and OpenAI's ChatGPT, the definition would look like
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version> <!-- replace with latest version -->
|
||||
</dependency>
|
||||
```
|
||||
|
||||
== AiClient Implementations
|
||||
|
||||
* OpenAI
|
||||
* Azure OpenAI
|
||||
* HuggingFace
|
||||
|
||||
Planned implementations
|
||||
* Amazon Bedrock - This can provide access to many AI models.
|
||||
* Google Vertex - Providing access to 'Bard', aka Palm2
|
||||
|
||||
Others are welcome, the list is not at all closed.
|
||||
|
||||
Note, there are several AI Model that are *not* OpenAI provided models, but expose an OpenAI compatible API.
|
||||
@@ -1,3 +0,0 @@
|
||||
= Data Loaders
|
||||
|
||||
TBD
|
||||
@@ -0,0 +1,3 @@
|
||||
= Document Readers
|
||||
|
||||
TBD
|
||||
@@ -1,3 +1,2 @@
|
||||
= Prompt
|
||||
= Prompts
|
||||
|
||||
TBD
|
||||
@@ -50,12 +50,27 @@ This pre-training feature transforms AI into a general developer tool that doesn
|
||||
== Prompts
|
||||
|
||||
Prompts serve as the foundation for language-based inputs that guide an AI model to produce specific outputs.
|
||||
While this might seem intuitive considering our interactions with ChatGPT, crafting effective prompts involves both an art and a science.
|
||||
The wording of the language utilized significantly impacts the AI model's responses, and their specific patterns and words are recognized by the model to guide responses in the intended direction.
|
||||
For those familiar with ChatGPT, a prompt might seem like merely the text entered into a dialog box that is sent to the API.
|
||||
However, it encompasses much more than that.
|
||||
In many AI Models, the text for the prompt is not just a simple String.
|
||||
|
||||
The importance of this skill has led to the emergence of "Prompt Engineering."
|
||||
When an effective prompt for a particular use case is identified, it is often shared within the community.
|
||||
ChatGPT's API has multiple text inputs within a prompt, with each text input being assigned a role.
|
||||
For example, there is the system role, that instructs the model how ot behave and sets the context for the interaction.
|
||||
There is also the user role, which is typically the input from the user.
|
||||
|
||||
Crafting effective prompts is both an art and a science.
|
||||
ChatGPT was designed for human conversations.
|
||||
This is quite a departure from using something like SQL to 'ask a question'.
|
||||
One must communicate with the AI model akin to conversing with another person.
|
||||
|
||||
Such is the importance of this interaction style that the term "Prompt Engineering" has emerged as its own discipline.
|
||||
There is a burgeoning collection of techniques that improve the effectiveness of prompts.
|
||||
Investing time in crafting a prompt can drastically improve the resulting output.
|
||||
|
||||
Sharing prompts has become a communcal practice, and there is active academic research being done on this subject.
|
||||
As an example of how counter-intuitive it can be to create effective prompt, for example contrasting with SQL, recent research paper found that one of the most effective prompts you can use starts with the phrase, "Take a deep breath and work on this problem step by step".
|
||||
That should give you an indication of how language is so important.
|
||||
We don't yet fully understand how to make the most effective use of previous iterations of this technology, such as ChatGPT 3.5, let alone new versions that are being developed.
|
||||
|
||||
== Prompt Templates
|
||||
|
||||
@@ -117,7 +132,7 @@ It uses the output from one call as the input to another.
|
||||
|
||||
By chaining calls together, you can support complex use cases by composing pipelines of multiple chains.
|
||||
|
||||
== Customizing Models: Integrating Your Data
|
||||
== Bringing Your Data to the AI model
|
||||
|
||||
How can you equip the AI model with information it hasn't been trained on?
|
||||
|
||||
@@ -127,38 +142,43 @@ An interesting bit of trivia is that this dataset is around ~650GB.
|
||||
|
||||
Two techniques exist for customizing the AI model to incorporate your data:
|
||||
|
||||
Fine Tuning: This traditional Machine Learning technique involves tailoring the model and changing its internal weighting.
|
||||
1. Fine Tuning: This traditional Machine Learning technique involves tailoring the model and changing its internal weighting.
|
||||
However, it's a challenging process for Machine Learning experts and extremely resource-intensive for models like GPT due to their size. Additionally, some models might not offer this option.
|
||||
|
||||
Prompt Stuffing: A more practical alternative involves embedding your data within the prompt provided to the model. Given a model's token limits, techniques are required to present relevant data within the model's context window.
|
||||
2. Prompt Stuffing: A more practical alternative involves embedding your data within the prompt provided to the model. Given a model's token limits, techniques are required to present relevant data within the model's context window.
|
||||
This approach is colloquially referred to as 'stuffing the prompt'.
|
||||
|
||||
The Spring AI library helps you implement solutions based on the 'stuffing of the prompt' technique.
|
||||
|
||||
The Spring AI library helps you implement solutions based on the 'stuffing of the prompt' technique otherwise knowsn as Retrieval Augmented Generation
|
||||
|
||||
== Retrieval Augmented Generation
|
||||
|
||||
A technique termed Retrieval Augmented Generation has emerged to address the challenge of incorporating relevant data into prompts for accurate AI model responses.
|
||||
A technique termed Retrieval Augmented Generation (RAG) has emerged to address the challenge of incorporating relevant data into prompts for accurate AI model responses.
|
||||
|
||||
The approach involves extracting data from your source and segmenting it into smaller units, each within the model's token limit. These pieces are then stored in a database.
|
||||
When a user's request is received, the most pertinent document fragments are retrieved from the database to enrich the prompt, aiding the AI model's response accuracy.
|
||||
The approach involves a batch processing style programming model, where the job reads unstructured data from your Documents, transforms it, and then writes it into a Vector Database.
|
||||
At a high level, this is an ETL (Extract, Transform and Load) pipeline.
|
||||
The Vector Database will be used in the retrieval part of RAG technique.
|
||||
|
||||
Data Loaders play a pivotal role in this process, reading and formatting your data into fragments suitable for database storage.
|
||||
For optimal retrieval of related documents, a Vector Database is the type of database best suited for this task.
|
||||
As part of loading the unstructured data into the Vector Database, one of the most important transformations is to split up the original document into smaller pieces.
|
||||
The procedure of splitting up the original document into smaller pieces has two important steps.
|
||||
|
||||
Data Loaders and Vector Database are the fundamental building blocks for solving use cases such as "Q&A over my documentation".
|
||||
1. Split up the document into parts while preserving the semantic boundaries of the content.
|
||||
For example, for a document with paragraphs and tables, one should avoid splitting the document in the middle of a paragraph or table.
|
||||
For code, avoid splitting the code in the middle of a method's implementation.
|
||||
2. Split up the document's parts further into parts whose size is a small percentage of the AI Model's token limit.
|
||||
|
||||
The next phase in RAG, is processing user input.
|
||||
When a user's question is to be answered by an AI model, the question along with all the 'similar' document pieces are placed into the prompt that is sent to the AI model.
|
||||
This is the reason to use a Vector Database, it is very good at finding 'similar' content.
|
||||
|
||||
There are several concepts that are used in implementing RAG.
|
||||
The concepts map onto classes in Spring AI.
|
||||
These are briefly described below
|
||||
|
||||
=== Data Loaders
|
||||
|
||||
=== Splitters
|
||||
|
||||
=== Embeddings
|
||||
|
||||
=== Vector Databases
|
||||
|
||||
TBD
|
||||
* `DocumentReader` This is an Java functional interface that is responsible for loading a `List<Document>` from a data source. Common data sources are PDF, Markdown, and JSON.
|
||||
* `Document` A text based representation of your data source that also contains metadata to describe the contents.
|
||||
* `DocumentTransformer` This is responsible for processing the data in various ways, for example splitting up documents into smaller pieces or adding additional metadata to the `Document`.
|
||||
* `DocumentWriter` This allows you to persist the Documents into a database, most commomly in the AI stack, a Vector Database.
|
||||
* `Embedding` This is a representation of your data as a `List<Double` that is used by the Vector Database to compute the 'similarity' of a user's query to relevant documents.
|
||||
|
||||
== Evaluating AI responses
|
||||
|
||||
|
||||
@@ -28,8 +28,53 @@ export SPRING_AI_AZURE_OPENAI_API_KEY=<INSERT KEY HERE>
|
||||
export SPRING_AI_AZURE_OPENAI_ENDPOINT=<INSERT ENDPOINT URL HERE>
|
||||
----
|
||||
|
||||
== Dependencies
|
||||
|
||||
The Spring AI project provides artifacts in the Spring Milestone Repository.
|
||||
You will need to add configuration to add a reference to the Spring Milestone repository in your build file.
|
||||
For example, in maven, add the following repository definition.
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/snapshot</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
----
|
||||
|
||||
Add the Spring Boot Starter depending on if you are using Azure Open AI or Open AI.
|
||||
|
||||
* Azure OpenAI
|
||||
[source, xml]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental.ai</groupId>
|
||||
<artifactId>spring-ai-azure-openai-spring-boot-starter</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
* OpenAI
|
||||
|
||||
[source, xml]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.springframework.experimental.ai</groupId>
|
||||
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
|
||||
<version>0.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
== Spring CLI
|
||||
|
||||
The Spring CLI makes it easy to create new applications with code in your terminal window. Think of it as the 'create-react-app' of Spring for those familiar with the JavaScript ecosystem.
|
||||
|
||||
Download the latest https://github.com/spring-projects-experimental/spring-cli/releases[Spring CLI Release]
|
||||
|
||||
and follow the https://docs.spring.io/spring-cli/reference/installation.html#_setting_up_your_path_or_alias[instructions] to add `spring` to your `PATH`.
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
:toc: left
|
||||
:toclevels: 4
|
||||
|
||||
[[configureClient]]
|
||||
== Configuring an `AiClient`
|
||||
|
||||
include::attributes.adoc[]
|
||||
|
||||
TBD
|
||||
|
||||
[[usingAiClient]]
|
||||
=== Using AiClient
|
||||
|
||||
TBD
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
:ai-asciidoc: ./
|
||||
@@ -1,19 +0,0 @@
|
||||
:toc: left
|
||||
:toclevels: 4
|
||||
|
||||
[[domainLanguageOfAi]]
|
||||
== The Domain Language of AI
|
||||
|
||||
include::attributes.adoc[]
|
||||
|
||||
TBD
|
||||
|
||||
|
||||
=== Prompt
|
||||
|
||||
TBD
|
||||
|
||||
|
||||
==== AiClient
|
||||
|
||||
TBD
|
||||
@@ -1,9 +0,0 @@
|
||||
'''
|
||||
Mark Pollack
|
||||
|
||||
Copyright © 2023 VMware, Inc. All Rights Reserved.
|
||||
|
||||
Copies of this document may be made for your own use and for
|
||||
distribution to others, provided that you do not charge any fee for such
|
||||
copies and further provided that each copy contains this Copyright
|
||||
Notice, whether distributed in print or electronically.
|
||||
@@ -1,6 +0,0 @@
|
||||
[[glossary]]
|
||||
[appendix]
|
||||
== Glossary
|
||||
|
||||
[glossary]
|
||||
=== Spring AI Glossary
|
||||
@@ -1 +0,0 @@
|
||||
= Spring AI - Reference Documentation
|
||||
@@ -1,20 +0,0 @@
|
||||
:doctype: book
|
||||
:toc: left
|
||||
:toclevels: 4
|
||||
:sectnums:
|
||||
|
||||
include::attributes.adoc[]
|
||||
|
||||
include::header/index-header.adoc[]
|
||||
|
||||
include::toggle.adoc[]
|
||||
|
||||
include::spring-ai-intro.adoc[]
|
||||
|
||||
include::domain.adoc[]
|
||||
|
||||
include::prompt.adoc[]
|
||||
|
||||
include::aiclient.adoc[]
|
||||
|
||||
include::glossary.adoc[]
|
||||
@@ -1,27 +0,0 @@
|
||||
include::attributes.adoc[]
|
||||
|
||||
include::header/index-header.adoc[]
|
||||
|
||||
// ======================================================================================
|
||||
|
||||
This documentation is also available
|
||||
as a link:index-single.html[single HTML file] and as link:../pdf/spring-ai-reference.pdf[PDF]
|
||||
and link:../epub/spring-ai-reference.epub[EPUB] documents.
|
||||
|
||||
The reference documentation is divided into several sections:
|
||||
|
||||
[horizontal]
|
||||
<<spring-ai-intro.adoc#spring-ai-intro,Spring AI Introduction>> :: Background, usage
|
||||
scenarios, and general guidelines.
|
||||
<<domain.adoc#domainLanguageOfAi,The Domain Language of AI>> :: Core concepts and abstractions
|
||||
of the AI domain language.
|
||||
<<prompt.adoc#createPrompt,Creating a Prompt>> :: Prompt creation.
|
||||
<<aiclient.adoc#configureClient,Configuring an AiClient>> :: AiClient configuration and execution.
|
||||
|
||||
The following appendices are available:
|
||||
|
||||
[horizontal]
|
||||
<<glossary.adoc#glossary,Glossary>> :: Glossary of common terms, concepts, and vocabulary of
|
||||
the AI domain.
|
||||
|
||||
include::footer/index-footer.adoc[]
|
||||
@@ -1,76 +0,0 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
var BATCH_LANGUAGES = ["java", "xml", "both"];
|
||||
var $xmlButton = $("#xmlButton");
|
||||
var $javaButton = $("#javaButton");
|
||||
var $bothButton = $("#bothButton");
|
||||
|
||||
var $xmlContent = $("*.xmlContent");
|
||||
var $xmlContentAll = $("*.xmlContent > *");
|
||||
|
||||
var $javaContent = $("*.javaContent");
|
||||
var $javaContentAll = $("*.javaContent > *");
|
||||
|
||||
// Initial cookie handler. This part remembers the
|
||||
// reader's choice and sets the toggle accordingly.
|
||||
var lang = window.localStorage.getItem("docToggle");
|
||||
if (BATCH_LANGUAGES.indexOf(lang) === -1) {
|
||||
lang = "java";
|
||||
$javaButton.prop("checked", true);
|
||||
setJava();
|
||||
} else {
|
||||
if (lang === "xml") {
|
||||
$xmlButton.prop("checked", true);
|
||||
setXml();
|
||||
}
|
||||
if (lang === "java") {
|
||||
$javaButton.prop("checked", true);
|
||||
setJava();
|
||||
}
|
||||
if (lang === "both") {
|
||||
$javaButton.prop("checked", true);
|
||||
setBoth();
|
||||
}
|
||||
}
|
||||
|
||||
// Click handlers
|
||||
$xmlButton.on("click", function() {
|
||||
setXml();
|
||||
});
|
||||
$javaButton.on("click", function() {
|
||||
setJava();
|
||||
});
|
||||
$bothButton.on("click", function() {
|
||||
setBoth();
|
||||
});
|
||||
|
||||
// Functions to do the work of handling the reader's choice, whether through a click
|
||||
// or through a cookie. 3652 days is 10 years, give or take a leap day.
|
||||
function setXml() {
|
||||
$xmlContent.show();
|
||||
$javaContent.hide();
|
||||
$javaContentAll.addClass("js-toc-ignore");
|
||||
$xmlContentAll.removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
window.localStorage.setItem('docToggle', 'xml');
|
||||
}
|
||||
|
||||
function setJava() {
|
||||
$javaContent.show();
|
||||
$xmlContent.hide();
|
||||
$xmlContentAll.addClass("js-toc-ignore");
|
||||
$javaContentAll.removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
window.localStorage.setItem('docToggle', 'java');
|
||||
}
|
||||
|
||||
function setBoth() {
|
||||
$javaContent.show();
|
||||
$xmlContent.show();
|
||||
$javaContentAll.removeClass("js-toc-ignore");
|
||||
$xmlContentAll.removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
window.localStorage.setItem('docToggle', 'both');
|
||||
}
|
||||
|
||||
});
|
||||
@@ -1,62 +0,0 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
redirect();
|
||||
|
||||
function redirect() {
|
||||
var anchorMap = {
|
||||
"#domain": "#domainLanguageOfBatch",
|
||||
"#domainJob": "#job",
|
||||
"#domainJobInstance": "#jobinstance",
|
||||
"#domainJobParameters": "#jobparameters",
|
||||
"#domainJobExecution": "#jobexecution",
|
||||
"#d5e455": "#jobexecution",
|
||||
"#d5e497": "#jobexecution",
|
||||
"#d5e507": "#jobexecution",
|
||||
"#d5e523": "#jobexecution",
|
||||
"#d5e550": "#jobexecution",
|
||||
"#d5e563": "#jobexecution",
|
||||
"#d5e591": "#jobexecution",
|
||||
"#domainStep": "#step",
|
||||
"#domainStepExecution": "#stepexecution",
|
||||
"#d5e655": "#stepexecution",
|
||||
"#domainExecutionContext": "#executioncontext",
|
||||
"#d5e721": "#executioncontext",
|
||||
"#d5e731": "#executioncontext",
|
||||
"#d5e745": "#executioncontext",
|
||||
"#d5e761": "#executioncontext",
|
||||
"#d5e779": "#executioncontext",
|
||||
"#domainJobRepository": "#jobrepository",
|
||||
"#domainJobLauncher": "#joblauncher",
|
||||
"#domainItemReader": "#item-reader",
|
||||
"#domainItemWriter": "#item-writer",
|
||||
"#domainItemProcessor": "#item-processor",
|
||||
"#domainBatchNamespace": "#batch-namespace",
|
||||
"#d5e970": "#jobparametersvalidator",
|
||||
"#d5e1130": "#commandLineJobRunner",
|
||||
"#d5e1232": "#jobregistry",
|
||||
"#d5e1237": "#jobregistrybeanpostprocessor",
|
||||
"#d5e1242": "#automaticjobregistrar",
|
||||
"#d5e1320": "#aborting-a-job",
|
||||
"#filiteringRecords": "#filteringRecords",
|
||||
"#d5e2247": "#flatFileItemReader",
|
||||
"#d5e2769": "#JdbcCursorItemReaderProperties",
|
||||
"#stepExecutionSplitter": "#partitioner",
|
||||
"#d5e3182": "#bindingInputDataToSteps",
|
||||
"#d5e3241": "#repeatStatus",
|
||||
"#d5e3531": "#testing-step-scoped-components",
|
||||
"#patterns": "#commonPatterns",
|
||||
"#d5e3959": "#item-based-processing",
|
||||
"#d5e3969": "#custom-checkpointing",
|
||||
"#available-attributes-of-the-job-launching-gateway": "#availableAttributesOfTheJobLaunchingGateway",
|
||||
"#d5e4425": "#itemReadersAppendix",
|
||||
"#d5e4494": "#itemWritersAppendix",
|
||||
"#d5e4788": "#recommendationsForIndexingMetaDataTables"
|
||||
};
|
||||
var baseUrl = window.location.origin + window.location.pathname;
|
||||
var anchor = window.location.hash;
|
||||
if (anchor && anchorMap[anchor] != null) {
|
||||
window.location.replace(baseUrl + anchorMap[anchor]);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
@@ -1,165 +0,0 @@
|
||||
/*!
|
||||
* JavaScript Cookie v2.1.4
|
||||
* https://github.com/js-cookie/js-cookie
|
||||
*
|
||||
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
||||
* Released under the MIT license
|
||||
*/
|
||||
;(function (factory) {
|
||||
var registeredInModuleLoader = false;
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(factory);
|
||||
registeredInModuleLoader = true;
|
||||
}
|
||||
if (typeof exports === 'object') {
|
||||
module.exports = factory();
|
||||
registeredInModuleLoader = true;
|
||||
}
|
||||
if (!registeredInModuleLoader) {
|
||||
var OldCookies = window.Cookies;
|
||||
var api = window.Cookies = factory();
|
||||
api.noConflict = function () {
|
||||
window.Cookies = OldCookies;
|
||||
return api;
|
||||
};
|
||||
}
|
||||
}(function () {
|
||||
function extend () {
|
||||
var i = 0;
|
||||
var result = {};
|
||||
for (; i < arguments.length; i++) {
|
||||
var attributes = arguments[ i ];
|
||||
for (var key in attributes) {
|
||||
result[key] = attributes[key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function init (converter) {
|
||||
function api (key, value, attributes) {
|
||||
var result;
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Write
|
||||
|
||||
if (arguments.length > 1) {
|
||||
attributes = extend({
|
||||
path: '/'
|
||||
}, api.defaults, attributes);
|
||||
|
||||
if (typeof attributes.expires === 'number') {
|
||||
var expires = new Date();
|
||||
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
|
||||
attributes.expires = expires;
|
||||
}
|
||||
|
||||
// We're using "expires" because "max-age" is not supported by IE
|
||||
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
|
||||
|
||||
try {
|
||||
result = JSON.stringify(value);
|
||||
if (/^[\{\[]/.test(result)) {
|
||||
value = result;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (!converter.write) {
|
||||
value = encodeURIComponent(String(value))
|
||||
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
||||
} else {
|
||||
value = converter.write(value, key);
|
||||
}
|
||||
|
||||
key = encodeURIComponent(String(key));
|
||||
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
|
||||
key = key.replace(/[\(\)]/g, escape);
|
||||
|
||||
var stringifiedAttributes = '';
|
||||
|
||||
for (var attributeName in attributes) {
|
||||
if (!attributes[attributeName]) {
|
||||
continue;
|
||||
}
|
||||
stringifiedAttributes += '; ' + attributeName;
|
||||
if (attributes[attributeName] === true) {
|
||||
continue;
|
||||
}
|
||||
stringifiedAttributes += '=' + attributes[attributeName];
|
||||
}
|
||||
return (document.cookie = key + '=' + value + stringifiedAttributes);
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
if (!key) {
|
||||
result = {};
|
||||
}
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling "get()"
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
var rdecode = /(%[0-9A-Z]{2})+/g;
|
||||
var i = 0;
|
||||
|
||||
for (; i < cookies.length; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var cookie = parts.slice(1).join('=');
|
||||
|
||||
if (cookie.charAt(0) === '"') {
|
||||
cookie = cookie.slice(1, -1);
|
||||
}
|
||||
|
||||
try {
|
||||
var name = parts[0].replace(rdecode, decodeURIComponent);
|
||||
cookie = converter.read ?
|
||||
converter.read(cookie, name) : converter(cookie, name) ||
|
||||
cookie.replace(rdecode, decodeURIComponent);
|
||||
|
||||
if (this.json) {
|
||||
try {
|
||||
cookie = JSON.parse(cookie);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (key === name) {
|
||||
result = cookie;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
api.set = api;
|
||||
api.get = function (key) {
|
||||
return api.call(api, key);
|
||||
};
|
||||
api.getJSON = function () {
|
||||
return api.apply({
|
||||
json: true
|
||||
}, [].slice.call(arguments));
|
||||
};
|
||||
api.defaults = {};
|
||||
|
||||
api.remove = function (key, attributes) {
|
||||
api(key, '', extend(attributes, {
|
||||
expires: -1
|
||||
}));
|
||||
};
|
||||
|
||||
api.withConverter = init;
|
||||
|
||||
return api;
|
||||
}
|
||||
|
||||
return init(function () {});
|
||||
}));
|
||||
@@ -1,9 +0,0 @@
|
||||
:toc: left
|
||||
:toclevels: 4
|
||||
|
||||
[[createPrompt]]
|
||||
== Creating a Prompt
|
||||
|
||||
include::attributes.adoc[]
|
||||
|
||||
TBD
|
||||
@@ -1,47 +0,0 @@
|
||||
:toc: left
|
||||
:toclevels: 4
|
||||
|
||||
include::attributes.adoc[]
|
||||
|
||||
ifdef::backend-spring-html[]
|
||||
This documentation is also available
|
||||
as link:index.html[multiple HTML files] and as link:../pdf/spring-ai-reference.pdf[PDF]
|
||||
and link:../epub/spring-ai-reference.epub[EPUB] documents.
|
||||
endif::[]
|
||||
|
||||
ifdef::backend-pdf[]
|
||||
This documentation is also available
|
||||
as link:index.html[multiple HTML files], a link:index-single.html[single HTML file],
|
||||
and an link:../epub/spring-ai-reference.epub[EPUB] document.
|
||||
endif::[]
|
||||
|
||||
ifdef::backend-epub3[]
|
||||
This documentation is also available
|
||||
as link:index.html[multiple HTML files], a link:index-single.html[single HTML file],
|
||||
and a link:../pdf/spring-ai-reference.pdf[PDF] document.
|
||||
endif::[]
|
||||
|
||||
[[spring-ai-intro]]
|
||||
== Spring AI Introduction
|
||||
|
||||
TBD
|
||||
|
||||
|
||||
[[springAiBackground]]
|
||||
=== Background
|
||||
|
||||
TBD
|
||||
|
||||
[[springAiUsageScenarios]]
|
||||
=== Usage Scenarios
|
||||
|
||||
TBD
|
||||
|
||||
==== Business Scenarios
|
||||
|
||||
TBD
|
||||
|
||||
==== Technical Objectives
|
||||
|
||||
TBD
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
ifdef::backend-spring-html[]
|
||||
+++
|
||||
<div>
|
||||
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="js/js.cookie.js"></script>
|
||||
<script type="text/javascript" src="js/DocumentToggle.js"></script>
|
||||
<script type="text/javascript" src="js/Redirect.js"></script>
|
||||
<div class="docToggle-button">
|
||||
<input id="xmlButton" type="radio" name="docToggle" value="XML"><label for="xmlButton">XML</label>
|
||||
<input id="javaButton" type="radio" name="docToggle" value="Java" checked><label for="javaButton">Java</label>
|
||||
<input id="bothButton" type="radio" name="docToggle" value="Both" checked><label for="bothButton">Both</label>
|
||||
</div>
|
||||
</div>
|
||||
+++
|
||||
endif::backend-spring-html[]
|
||||
Reference in New Issue
Block a user