### Install LMOS Starter Demo Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/01-demo_guide.md Runs the installation script for the 'starter' demo, located in the `demos` folder, to deploy a specific LMOS demo setup onto the Minikube cluster. ```shell ./demos/starter/install.sh ``` -------------------------------- ### Define Arc Agents with Kotlin `agents` function Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/00-manual_setup.md This Kotlin example demonstrates how to define and configure AI agents using the `agents` function within the Arc Framework. It shows setting an OpenAI API key, defining a custom function, and creating an agent with a specific model, tools, and a system prompt. The agent is then used to ask a question and print the reply. ```kotlin fun main() = runBlocking { // Set the OpenAI API key as a system property or environment variable. System.setProperty("OPENAI_API_KEY", "****") val agents = agents( functions = { function(name = "get_weather", description = "Returns the current weather.") { "the weather is sunny!" } // add more functions here } ) { agent { name = "MyAgent" model { "gpt-4o" } tools { +"get_weather" } prompt { """ You are a weather assistant. Help the user with their questions about the weather. """ } } // add more agents here } val reply = agents.getChatAgent("MyAgent").ask("What is the weather like?").getOrNull() println(reply) } ``` -------------------------------- ### Install LMOS onto Minikube Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/01-demo_guide.md Executes the installation script to deploy LMOS components onto the Minikube Kubernetes cluster, which is pre-configured within the development container. ```shell ./install.sh ``` -------------------------------- ### Event Subscriptions GraphQL Example Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/05-spring/graphql.md Provides a GraphQL subscription example to access all events emitted by the Arc application, which can be useful for debugging purposes. This feature needs to be explicitly enabled in the application configuration. ```graphql subscription { events { type payload conversationId } } ``` -------------------------------- ### Install Arc-View Web Chart with Helm Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/02-installation.md Installs or upgrades the arc-view-web chart from its OCI registry path. This command deploys the specified version of the arc-view web component into the Kubernetes cluster. ```bash helm upgrade --install arc-view-web oci://ghcr.io/eclipse-lmos/arc-view-web-chart --version 0.1.0 ``` -------------------------------- ### Example WebSocket Handshake HTTP Request Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/11-websocket_binding.md An example HTTP GET request demonstrating the initiation of a WebSocket connection with an LMOS-compatible agent or tool. It includes standard WebSocket headers and specifically requests the 'lmosprotocol' subprotocol. ```http GET wss://agentserver.com/agent Host: agentserver.com Origin: https://agentserver.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Protocol: lmosprotocol Sec-WebSocket-Version: 13 ``` -------------------------------- ### Update Helm Repositories Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/02-installation.md Updates all configured Helm repositories to ensure access to the latest chart versions and metadata. ```bash helm repo update ``` -------------------------------- ### Verify LMOS Installation Status Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/01-demo_guide.md Checks the status of Kubernetes pods to confirm successful installation and running state of LMOS components. All pods should show '2/2 Running'. The example output demonstrates the expected result. ```shell kubectl get pods ``` ```text NAME READY STATUS RESTARTS AGE arc-view-web-db8d87c59-54k7b 2/2 Running 0 87s lmos-operator-64bfb9b569-4l9qv 2/2 Running 0 2m22s lmos-runtime-59ffdbdc6f-v5jtr 2/2 Running 0 2m21s ``` -------------------------------- ### Clone LMOS Demo Repository Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/01-demo_guide.md Clones the LMOS Demo Git repository from GitHub and navigates into its directory. This is the initial step to prepare the local development environment for LMOS. ```shell git clone https://github.com/eclipse-lmos/lmos-demo.git cd lmos-demo ``` -------------------------------- ### Example LMOS Tool Description JSON Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/05-tool_description.md This JSON snippet provides a concrete example of an LMOS Tool description. It demonstrates the use of `@context` for defining namespaces, `@type` to identify it as an LMOS Tool, and includes basic properties like `id`, `title`, and custom `lmos:metadata` for vendor information. ```json { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", { "lmos": "https://eclipse.dev/lmos/protocol/v1" } ], "@type": "lmos:Tool", "id": "urn:uuid:3f1d3a7a-4f97-2e6b-c45f-f3c2e1c84c77", "title": "Tool Name", "lmos:metadata": { "lmos:vendor": { "lmos:name": "Deutsche Telekom AG", "lmos:url": "https://telekom.de" } } } ``` -------------------------------- ### Define Agent Instructions for Weather Agent Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/00-index.md This Markdown snippet provides an example of instructions for an Arc Agent, guiding its behavior and interaction logic. These instructions are part of the agent's system prompt and cover aspects like handling irrelevant queries, maintaining a friendly tone, informing users about data limitations, and specifying the use of a `get_weather` function for data retrieval. ```md # Instructions - If the user asks a question that is not related to weather, simply reply I cant help you - Be kind and friendly to the user. - Inform the user that the weather data is not real-time data. - Use the get_weather function to get the weather data. ``` -------------------------------- ### Define a Basic Arc AI Agent with Kotlin DSL Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/01-quickstart.md This Kotlin code snippet demonstrates how to define a simple Arc AI Agent using the framework's DSL. It initializes an agent named 'MyAgent' that uses the 'gpt-4o' model and includes a placeholder for the prompt. It also shows how to set the OpenAI API key (commented out) and serve the agent in development mode. ```kotlin fun main(): Unit = runBlocking { // Set the OpenAI API as a System property or environment variable. // System.setProperty("OPENAI_API_KEY", "****") agents { agent { name = "MyAgent" model { "gpt-4o" } prompt { """ Add your prompt here. """ } } }.serve(devMode = true) } ``` -------------------------------- ### Install or Upgrade LMOS Operator with Helm Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/02-installation.md Installs or upgrades the lmos-operator chart from its OCI registry path. This command ensures the specified version of the operator is deployed or updated in the Kubernetes cluster. ```bash helm upgrade --install lmos-operator oci://ghcr.io/eclipse-lmos/lmos-operator-chart --version 0.4.0 ``` -------------------------------- ### Start Zipkin Server via Docker Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/02-ccore/23-tracing.md This shell command shows how to quickly launch a Zipkin trace server as a Docker container, exposing its default UI and API port. ```shell docker run -d -p 9411:9411 openzipkin/zipkin ``` -------------------------------- ### Arc Framework Gradle Dependencies Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/00-manual_setup.md This section provides Gradle Kotlin Script (KTS) dependency declarations for integrating the Arc Framework and its various AI client modules into a project. It includes the base `arc-agents` dependency and specific dependencies for Azure/OpenAI, Gemini, Ollama, and Bedrock clients, along with their respective `langchain4j` integrations where applicable. ```gradle implementation("org.eclipse.lmos:arc-agents:$arcVersion") ``` ```gradle implementation("org.eclipse.lmos:arc-azure-client:$arcVersion") ``` ```gradle implementation("org.eclipse.lmos:arc-langchain4j-client:$arcVersion") implementation("dev.langchain4j:langchain4j-google-ai-gemini:$langchain4jVersion") ``` ```gradle implementation("org.eclipse.lmos:arc-langchain4j-client:$arcVersion") implementation("dev.langchain4j:langchain4j-ollama:$langchain4jVersion") ``` ```gradle implementation("org.eclipse.lmos:arc-langchain4j-client:$arcVersion") implementation("dev.langchain4j:langchain4j-bedrock:$langchain4jVersion") ``` -------------------------------- ### Interact with LMOS Agent using Kotlin Client SDK Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/03-kotlin_sdk.md This Kotlin example demonstrates how to instantiate a `WotConversationalAgent` by providing its Thing Description (TD) endpoint. It then illustrates basic interactions such as sending a chat message to the agent and setting up a consumer for agent events. ```kotlin val agent = WotConversationalAgent .create("http://localhost:9080/weather-agent") // Interacting with the agent via chat val answer = agent.chat("What is the weather in London?") // Consuming an event from the agent, // but the ChatAgent does not provide any events in this example agent.consumeEvent("agentEvent") { println("Event: $it") } ``` -------------------------------- ### Example Kotlin DSL for Agent Definition with Time and Memory Functions Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/01-dsl/gloassary.md This snippet demonstrates how to define an agent using the Arc Framework DSL in Kotlin, incorporating `memory` to retrieve user data and `time` to get the current timestamp within a prompt. ```kotlin agent { name = "MyAgent" prompt { val name = memory("user_name") """ The user's name is $name. The time is ${time()} """ } } ``` -------------------------------- ### Agent Query GraphQL Example Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/05-spring/graphql.md Illustrates a simple GraphQL query to retrieve the names of all active agents currently running on the server. ```graphql query { agent { names } } ``` -------------------------------- ### Pull and Serve Llama3 8B with Ollama Source: https://github.com/eclipse-lmos/website/blob/source/blog/Llama3.md This snippet provides the necessary commands to download the Llama3 8B model and start the Ollama server locally. Once the server is running, the model becomes accessible for local inference with compatible client applications like Arc. The 8B variant is recommended for local use due to its manageable 8GB RAM requirement. ```bash ollama pull llama3:8b ollama serve ``` -------------------------------- ### Configure OpenAI API Connection Details Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/01-demo_guide.md Sets up necessary environment variables for OpenAI API access within the development container's .env file. These configurations are crucial for `lmos-runtime` and various agents to interact with OpenAI services. ```shell OPENAI_APIKEY="" OPENAI_CLIENTNAME="openai" OPENAI_MODELNAME="gpt-4o-mini" OPENAI_URL="https://api.openai.com" OPENAI_PROVIDER="openai" ``` -------------------------------- ### PDF File Location Examples Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/02-ccore/03-readers/pdf.md Examples of valid paths for loading PDF files, including remote URLs and local file system paths. ```text https://example.com/file.pdf file://path/to/file.pdf ``` -------------------------------- ### GraphQL Subscription Example for Arc Agent Request Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/02-ccore/11-api.md An example GraphQL subscription query demonstrating how to send an Agent Request with conversation, user, and message details to an 'assistant-agent'. This snippet illustrates the practical application of the Arc Agent Request data model within a GraphQL context. ```GraphQL subscription { agent( agentName: "assistant-agent" request: { conversationContext: { conversationId: "1" } systemContext: [], userContext: { userId: "1234", profile: [{ key: "name", value: "Pat" }] }, messages: [ { role: "user", content: "Hi", format: "text", } ] } ) { messages { content } } } ``` -------------------------------- ### Arc Framework LLM Client Configuration Variables Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/00-manual_setup.md This section details the environment variables and system properties used by the Arc Framework to automatically load and configure LLM clients. It lists variable names, their descriptions, accepted values, and whether they are required, covering general client selection, model aliasing, model names, API endpoints, and various authentication keys for providers like Azure, OpenAI, Ollama, Gemini, and Bedrock. It also notes the order of variable resolution and support for multiple client definitions. ```APIDOC LLM Client Configuration Variables: ARC_CLIENT: Description: The client library to use. Values: azure, openai, ollama, gemini, bedrock Required: yes ARC_MODEL_ALIAS: Description: An alias for the model name. If set, this value must be referenced on the Agent DSL. Values: (empty) Required: no ARC_MODEL: Description: The name of the model. Values: (empty) Required: only if ARC_MODEL_ALIAS is set. ARC_AI_URL: Description: The endpoint of the model. Values: (empty) Required: not required for openai nor ollama. ARC_AI_KEY: Description: The api key to access the model. Values: (empty) Required: (empty) ARC_AI_ACCESS_KEY: Description: The access key to access the model. Values: (empty) Required: usually required for bedrock. ARC_AI_ACCESS_SECRET: Description: The access secret to access the model. Values: (empty) Required: usually required for bedrock. Additional Notes: - OPENAI_API_KEY can also be used to create an OpenAI client. - Multiple clients can be defined by appending an index to the variable name (e.g., ARC_CLIENT[0], ARC_CLIENT[1]). Max 10 clients. - Variables are resolved in the following order: 1. System properties, 2. Environment variables, 3. home/.arc/arc.properties ``` -------------------------------- ### Define Basic Password Reset Use Case Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/22-use_cases.md Demonstrates the fundamental structure of a use case definition in markdown, outlining a password reset scenario with description, steps, solution, fallback, and example queries. ```markdown ### UseCase: password_reset #### Description Customer has forgotten their password and needs to reset it. #### Steps - Ask the customer for their registered email address. - Send a password reset link to the provided email address. #### Solution Guide the customer through the password reset process defined on the webpage https://www.example.com/reset-password. #### Fallback Solution If the customer cannot access their email, escalate the issue to a higher tier of support. #### Examples - I forgot my password. ``` -------------------------------- ### Example JSON for Observing a Property Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/10-communication_protocol.md Shows a sample `observeProperty` message, demonstrating how to initiate observation of a specific property ('modelConfiguration') on a Thing. This message is sent to request continuous updates for the specified property. ```json { "thingId": "urn:uuid:3f1d3a7a-4f97-2e6b-c45f-f3c2e1c84c77", "messageId": "abcd1234-5678-90ef-ghij-klmnopqrstuv", "messageType": "observeProperty", "name": "modelConfiguration" } ``` -------------------------------- ### Example WebSocket Handshake HTTP Response Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/11-websocket_binding.md An example HTTP 101 Switching Protocols response confirming the successful upgrade to a WebSocket connection. It includes the necessary headers to acknowledge the upgrade and the acceptance of the 'lmosprotocol' subprotocol. ```http HTTP 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk= Sec-WebSocket-Protocol: lmosprotocol ``` -------------------------------- ### Minimal LMOS Agent Description JSON Example Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/04-agent_description.md Illustrates a basic LMOS Agent Description JSON, showcasing the required `@context` and `@type` fields, along with `id`, `title`, and an example of `lmos:metadata` for vendor information. This snippet demonstrates the fundamental structure for defining an LMOS agent. ```json { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", { "lmos": "https://eclipse.dev/lmos/protocol/v1" } ], "@type": "lmos:Agent", "id": "urn:uuid:6f1d3a7a-1f97-4e6b-b45f-f3c2e1c84c77", "title": "Agent Name", "lmos:metadata": { "lmos:vendor": { "lmos:name": "Deutsche Telekom AG", "lmos:url": "https://telekom.de" } } } ``` -------------------------------- ### Load Use Cases with Conditions in Kotlin Script Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/22-use_cases.md Provides a Kotlin Script example demonstrating the `useCases` function, showing how to load use case definitions from a markdown file and apply a set of conditions to filter the content. ```kts useCases("use_cases.md", conditions = setOf("isBusinessCustomer")) ``` -------------------------------- ### Install Arc CLI on Windows Powershell Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/17-cli.md Installs the Arc CLI on Windows using Powershell. This involves setting the execution policy, adding trust for the Arc repository, and installing the arc-runner application via the jbang.dev Powershell script. This method also handles Java installation. ```powershell Set-ExecutionPolicy RemoteSigned -scope CurrentUser iex "& { $(iwr https://ps.jbang.dev) } trust add https://github.com/eclipse-lmos/arc/blob/main/arc-runner/" iex "& { $(iwr https://ps.jbang.dev) } app install --fresh --force https://github.com/eclipse-lmos/arc/blob/main/arc-runner/arc.java" ``` -------------------------------- ### Agent Subscription GraphQL Example Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/05-spring/graphql.md Demonstrates how to use a GraphQL subscription to send a request to an Arc Agent and receive a stream of responses. This approach leverages a websocket connection for robustness against timeouts and enables the agent to send multiple updates for long-running tasks. ```graphql subscription { agent( agentName: "assistant-agent" request: { conversationContext: { conversationId: "1" } systemContext: [], userContext: { userId: "1234", profile: [{ key: "name", value: "Pat" }] }, messages: [ { role: "user", content: "Hi", format: "text", } ] } ) { messages { content } } } ``` -------------------------------- ### Kotlin-WoT Client Interaction with Weather Agent Source: https://github.com/eclipse-lmos/website/blob/source/docs/multi_agent_system/agent_description.md Kotlin code demonstrating how to consume a Web of Things (WoT) Thing Description and interact with the 'getWeather' action of a Weather Agent using the `kotlin-wot` library. The example shows the steps for initializing protocols, requesting and consuming the Thing Description from a specified URL, preparing input parameters for the action, and invoking the 'getWeather' action to retrieve weather data. ```kotlin suspend fun fetchWeather(question: String, interactionMode: String) { try { // Initialize the protocols which should be supported val servient = Servient( clientFactories = listOf(HttpProtocolClientFactory()) ) // Initialize the WoT client val wot = Wot.create(servient) // Request the Thing Description from the Weather Agent val td: ThingDescription = wot.requestThingDescription("http://weatheragent.example.com/td") // Consume the Thing Description val thing = wot.consume(td) // Prepare input parameters for the action val inputParams = mapOf( "question" to question, "interactionMode" to interactionMode ) // Invoke the getWeather action val weatherResponse = thing.invokeAction("getWeather", inputParams.toInteractionInputValue()) val weatherData = weatherResponse.value(); println("Weather data: $weatherData") } catch (err: Exception) { println("Error fetching weather: ${err.message}") } } ``` -------------------------------- ### Start Phoenix Server via Docker Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/02-ccore/23-tracing.md This shell command demonstrates how to run the Phoenix trace visualization server as a Docker container, mapping necessary ports for trace ingestion and UI access. ```shell docker run -p 6006:6006 -p 4317:4317 -i -t arizephoenix/phoenix:latest ``` -------------------------------- ### Example JSON for Single Property Reading Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/10-communication_protocol.md Demonstrates a `propertyReading` message, showing how a Thing reports the value of a specific property, including its timestamp and an optional correlation ID. This example shows the 'modelConfiguration' property being read with its nested object value. ```json { "thingID": "urn:uuid:3f1d3a7a-4f97-2e6b-c45f-f3c2e1c84c77", "messageID": "79057736-3e0e-4dc3-b139-a33051901ee2", "messageType": "propertyReading", "name": "modelConfiguration", "value": { "modelName": "gpt-4o", "temperature": 0.7, "maxTokens": 1000 }, "timestamp": "2024-01-13T23:20:50.52Z", "correlationID": "5afb752f-8be0-4a3c-8108-1327a6009cbd" } ``` -------------------------------- ### Add Arc Framework Dependencies to Gradle Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/01-quickstart.md This Kotlin Gradle script snippet shows the necessary dependencies to include the Arc Agents, Arc Server, and Arc Azure Client libraries in a Kotlin-based Gradle project. These dependencies are crucial for building and running Arc AI Agents. ```kotlin implementation("org.eclipse.lmos:arc-agents:$arcVersion") implementation("org.eclipse.lmos:arc-server:$arcVersion") implementation("org.eclipse.lmos:arc-azure-client:$arcVersion") ``` -------------------------------- ### Example User Input for Web Page Summarization Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/04-cookbook/summarizer.md This snippet illustrates a typical user query for the Summarizer Agent. It shows how a user would ask the agent to summarize a specific article by providing its URL. This input would trigger the agent's `filterInput` logic to fetch and process the web page content. ```text Please summarize the following article: https://www.theregister.com ``` -------------------------------- ### Run Arc Server and Agents Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/17-cli.md Starts the Arc server, which hosts and manages your configured Arc agents. This command makes your agents accessible for interaction and processing. ```cli arc run agents ``` -------------------------------- ### Example tracestate Header Format Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/08-observability.md Illustrates the structure of the W3C Trace Context `tracestate` header, showing key-value pairs for vendor-specific or system-specific trace information. This optional header enhances observability by incorporating metadata relevant to different tracing systems. ```text tracestate: =,= ``` -------------------------------- ### Supported HTML File and URL Input Formats Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/02-ccore/03-readers/html.md Examples of valid paths and URLs that can be passed to the `html` function for content retrieval. These illustrate how to specify both remote web pages and local files. ```text https://example.com/index.html file://path/to/index.html ``` -------------------------------- ### Example W3C Decentralized Identifier (DID) Document with Service Endpoint Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/09-security.md This JSON object illustrates the structure of a W3C Decentralized Identifier (DID) document, including its context, unique ID, controller, verification methods (public keys), authentication, assertion methods, and a service endpoint. It demonstrates how a DID can reference an agent's service endpoint, providing a concrete example of a DID anchored to the 'web' method. ```json { "@context": [ "https://www.w3.org/ns/did/v1" ], "id": "did:web:telekom.de:agents:billing", "controller": "did:web:telekom.de", "verificationMethod": [ { "id": "did:web:telekom.de:agents:billing#keys-1", "type": "Ed25519VerificationKey2018", "controller": "did:web:telekom.de:agents:billing", "publicKeyBase58": "5K7X5M1M9fjp2tLDgb5mtJfa2v4eqHGKZ9bdU2R6gKkF" } ], "authentication": [ "did:web:telekom.de:agents:billing#keys-1" ], "assertionMethod": [ "did:web:telekom.de:agents:billing#keys-1" ], "service": [ { "id": "did:web:telekom.de:agents:billing#td", "type": "WotThing", "serviceEndpoint": "https://billings.agents.telekom.de/.well-known/wot" } ] } ``` -------------------------------- ### Verify LMOS Operator Pods Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/02-installation.md Checks the status of Kubernetes pods in a specified namespace to confirm the successful deployment and running state of the lmos-operator. ```bash kubectl get pods -n ``` -------------------------------- ### Configure ARC Agent for Use Case Handling Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/22-use_cases.md This Kotlin DSL example demonstrates how to configure an ARC Agent to effectively manage use cases. It integrates the `UseCaseResponseHandler` for tracking solutions and triggering fallbacks, defines detailed prompt instructions for agent behavior, and includes use cases from a markdown file using the `useCases` function with a specified `fallbackLimit`. ```Kotlin agent { name = "password-help-agent" description = "Agent that helps customers with password-related issues." filterOutput { +UseCaseResponseHandler() } prompt { """ You are a professional service agent. ## Instructions - Only provide information the user has explicitly asked for. - Always start the message with the id of the use case id. Example, " - Use the "Knowledge" section or llm functions to answer customers queries. - Always follow the fallback solution for a problem if provided. - If the customer's question is on a topic not described in the "Knowledge" section nor llm functions, reply with "NO_ANSWER". - Always performed the steps stated in the "Steps" associated with the solution, if any, before providing the solution. - Only perform one step at a time! - If the customer does not accept the solution, reply with "NO_ANSWER". ## Knowledge ${useCases("use_cases.md", fallbackLimit = 3)} """ } tools { +"send_password_reset_link" } } ``` -------------------------------- ### Full LMOS Agent Description JSON Example with Properties and Security Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/04-agent_description.md Presents a comprehensive LMOS Agent Description JSON, including `links`, `securityDefinitions`, and detailed `properties`. It demonstrates how to define interaction affordances like `modelConfiguration` with nested properties, types, and descriptions, providing a richer representation of an agent's capabilities and security. ```json { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", { "lmos": "https://eclipse.dev/lmos/protocol/v1" } ], "id": "urn:uuid:6f1d3a7a-1f97-4e6b-b45f-f3c2e1c84c77", "title": "WeatherAgent", "@type": "lmos:Agent", "links": [{ "rel": "service-doc", "href": "https://weatherai.example.com/manual.pdf", "type": "application/pdf", "hreflang": "en" }], "lmos:metadata": { "lmos:vendor": { "lmos:name": "Deutsche Telekom AG", "lmos:url": "https://telekom.de" } }, "securityDefinitions": { "basic_sc": { "scheme": "basic", "in": "header" } }, "security": "basic_sc", "properties": { "modelConfiguration": { "description": "Current configuration of the underlying LLM, including version, temperature, and maximum tokens.", "type": "object", "readOnly": true, "properties": { "modelName": { "type": "string", "description": "Name of the model in use, e.g., gpt-4o." }, "temperature": { "type": "number", "description": "Temperature setting for controlling response randomness.", "minimum": 0, "maximum": 1 }, "maxTokens": { "type": "integer", "description": "Maximum number of tokens the model is allowed to generate." } }, "forms": [ { "op": "readproperty", "href": "https://weatherai.example.com/things/urn:uuid:6f1d3a7a-1f97-4e6b-b45f-f3c2e1c84c77/properties/modelConfiguration" } ] } } } ``` -------------------------------- ### Example: Subscribe to All Events JSON Request Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/10-communication_protocol.md A sample JSON request payload for the 'subscribeAllEvents' message, showing the `thingId`, `messageId`, and the fixed `messageType` to subscribe to all events from a Thing. ```json { "thingId": "urn:uuid:3f1d3a7a-4f97-2e6b-c45f-f3c2e1c84c77", "messageId": "abcd1234-5678-90ef-ghij-klmnopqrstuv", "messageType": "subscribeAllEvents" } ``` -------------------------------- ### Fetch Weather Data with Node-WoT Source: https://github.com/eclipse-lmos/website/blob/source/docs/multi_agent_system/agent_description.md This JavaScript example demonstrates how to use the `node-wot` library to connect to a Weather Agent. It initializes the Servient, adds an HTTP client factory, requests the Thing Description (TD) from a specified URL, consumes the TD, and then invokes the 'getWeather' action with provided question and interaction mode parameters. Error handling is included. ```javascript const WoT = require('@node-wot/core'); const HttpClientFactory = require('@node-wot/binding-http'); async function fetchWeather(question, interactionMode) { try { // Initialize the protocols which should be supported const servient = new Servient(); servient.addClientFactory(new HttpClientFactory()); // Request the Thing Description from the Weather Agent const td = await WoT.requestThingDescription("http://weatheragent.example.com/td"); // Consume the Thing Description const thing = await WoT.consume(td); // Prepare input parameters for the action const inputParams = { question: question, interactionMode: interactionMode }; // Invoke the getWeather action const weatherResponse = await thing.invokeAction("getWeather", inputParams); const weatherData = await weatherResponse.value(); } catch (err) { console.error("Error fetching weather:", err); } } // Example usage const question = 'What is the weather in berlin?'; const interactionMode = 'text'; fetchWeather(question, interactionMode); ``` -------------------------------- ### Configure Basic Spring Boot Gradle Plugin for OCI Image Build Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/03-kotlin_sdk.md This Gradle configuration applies the Spring Boot plugin and sets the `imageName` for the OCI image to be built. It's a basic setup for local image creation, ensuring the necessary plugins are applied for image generation. ```gradle plugins { id 'org.springframework.boot' version '3.0.0' id 'io.spring.dependency-management' version '1.1.0' id 'java' } springBoot { buildImage { imageName = 'your-docker-repo/your-app-name:latest' } } ``` -------------------------------- ### Example traceparent Header Format Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/08-observability.md Illustrates the structure of the W3C Trace Context `traceparent` header, showing placeholders for version, trace ID, span ID, and trace flags. This header is crucial for linking different services in a distributed trace. ```text traceparent: 00--- ``` -------------------------------- ### Example LMOS AgentRequest Message JSON Structure Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/03-kotlin_sdk.md This JSON snippet illustrates the structure of an `AgentRequest` message used within the LMOS SDK. It includes fields for `conversationContext`, `systemContext`, `userContext`, and a list of `messages` with `role`, `content`, and `format`, demonstrating a typical user query to an agent. ```json { "conversationContext": { "conversationId": "1" }, "systemContext": [ { "key": "channelId", "value": "web" } ], "userContext": { "userId": "1234", "profile": [ { "key": "name", "value": "Max Mustermann" } ] }, "messages": [ { "role": "user", "content": "What is the weather in London?", "format": "text" } ] } ``` -------------------------------- ### Apache License 2.0 Boilerplate Notice Source: https://github.com/eclipse-lmos/website/blob/source/static/chat/assets/fonts/LICENSE.txt The standard boilerplate notice to be included in files to apply the Apache License, Version 2.0. This text should be enclosed in the appropriate comment syntax for the file format (e.g., /* ... */ for C/Java, # ... for Python, for HTML). Remember to replace '[yyyy]' with the year and '[name of copyright owner]' with the actual copyright holder's name. ```Plain Text Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` -------------------------------- ### Configure Spring Boot Application with YAML for ARC Agent Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/03-kotlin_sdk.md Provides an example `application.yaml` file for configuring a Spring Boot application. It sets the application name, defines ARC AI client details (ID, model name, API key, client type, URL), and enables both WebSocket and HTTP servers for the LMOS servient, specifying their host and port. ```yaml spring: application: name: chat-agent arc: ai: clients: - id: GPT-4o # The id must match the model in the AgentConfiguration model-name: api-key: client: openai url: wot: servient: websocket: server: enabled: true host: localhost port: 8181 http: server: enabled: true host: localhost port: 9080 ``` -------------------------------- ### Weather Agent Thing Description (WoT TD) Example Source: https://github.com/eclipse-lmos/website/blob/source/docs/multi_agent_system/agent_description.md A detailed W3C Web of Things (WoT) Thing Description (TD) in JSON format for a Weather Agent. This TD defines the agent's metadata, including its AI model (gpt-4o from Azure), service integrations (OpenWeatherMap), data privacy measures (GDPR compliance, anonymization), and interaction modes (text/voice, English/German). It specifies basic authentication as a security scheme and outlines a single action, 'getWeather', which accepts a natural language question and interaction mode, returning weather information. ```json { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", { "htv": "http://www.w3.org/2011/http#", "lmos": "https://eclipse.dev/lmos/protocol/v1" }, "https://schema.org/" ], "id": "urn:uuid:6f1d3a7a-1f97-4e6b-b45f-f3c2e1c84c77", "title": "WeatherAgent", "@type": "lmos:Agent", "lmos:metadata": { "lmos:vendor": { "lmos:name": "WeatherAI Inc.", "lmos:url": "https://weatherai.example.com" }, "lmos:model": { "lmos:name": "gpt-4o", "lmos:provider": "Azure" }, "lmos:serviceIntegration": { "lmos:weatherAPI": "OpenWeatherMap", "lmos:apiVersion": "v2.5", "lmos:apiDocumentation": "https://openweathermap.org/api" }, "lmos:dataPrivacy": { "lmos:dataRetentionPeriod": "30 days", "lmos:anonymizationMethod": "HASHING" }, "lmos:interaction": { "lmos:supportedLanguages": ["en_US", "de_DE"], "lmos:interactionMode": ["text", "voice"] }, "lmos:compliance": { "lmos:regulatoryCompliance": "GDPR" } }, "securityDefinitions": { "basic_sc": { "scheme": "basic", "in": "header" } }, "security": "basic_sc", "actions": { "getWeather": { "description": "Fetches weather information based on user input.", "safe": true, "idempotent": false, "synchronous": true, "input": { "type": "object", "properties": { "question": { "type": "string" }, "interactionMode": { "type": "string", "enum": ["text", "voice"] } }, "required": ["question","interactionMode"] }, "output": { "type": "string", "description": "Natural language output providing weather information." }, "forms": [ { "op": "invokeaction", "href": "https://weatherai.example.com/weather", "contentType": "application/json", "htv:methodName":"POST" } ] } } } ``` -------------------------------- ### Access Beans in Arc Agent DSL with BeanProvider Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/02-ccore/00-component_overview.md This Kotlin DSL example demonstrates how to define an agent (`weather-agent`) and access arbitrary beans provided by a `BeanProvider` using the `get()` method within the agent's prompt. It shows how to inject external data, like weather information, into the agent's context. ```kotlin agent { name = "weather-agent" description = "A helpful assistant that can provide information about the weather." prompt { val weather = get() """ You are a helpful assistant that provides weather information. The current weather is $weather. """ } } ``` -------------------------------- ### BeanProvider Interface Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/02-ccore/00-component_overview.md The `BeanProvider` interface enables the provision of arbitrary beans for use within the Arc Agent DSL. These beans can be accessed anywhere in the DSL using the `get()` method. In `arc-spring-boot-starter`, it automatically provides access to all beans in the Spring context. ```APIDOC BeanProvider: Purpose: Provides arbitrary beans for use in Arc Agent DSL. Access Method (DSL): get() Spring Boot Integration: Automatically provides access to all Spring context beans. ``` -------------------------------- ### Example JSON for Writing Multiple Properties Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/10-communication_protocol.md Illustrates the message structure for writing multiple properties to a Thing, including nested configuration data like 'modelConfiguration' with 'modelName', 'temperature', and 'maxTokens'. This message type is typically used to update several attributes of a Thing simultaneously. ```json { "thingId": "urn:uuid:3f1d3a7a-4f97-2e6b-c45f-f3c2e1c84c77", "messageId": "abcd1234-5678-90ef-ghij-klmnopqrstuv", "messageType": "writeMultipleProperties", "data": { "modelConfiguration": { "modelName": "gpt-4o", "temperature": 0.7, "maxTokens": 1000 }, "otherProperty": 60 } } ``` -------------------------------- ### Example WoT Thing Description with Action Binding Source: https://github.com/eclipse-lmos/website/blob/source/docs/multi_agent_system/agent_communication.md This JSON snippet illustrates a W3C Web of Things (WoT) Thing Description (TD) for a 'WeatherAgent'. It defines an 'getWeather' action with specific input parameters (question, interactionMode) and an output type. The 'forms' field within the action demonstrates a protocol binding, specifying how to invoke this action via an HTTP POST request to a given URL, using 'application/json' content type. ```JSON { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", { "htv": "http://www.w3.org/2011/http#" }, "https://schema.org/" ], "id": "urn:uuid:6f1d3a7a-1f97-4e6b-b45f-f3c2e1c84c77", "title": "WeatherAgent", "actions": { "getWeather": { "description": "Fetches weather information based on user input.", "safe": true, "idempotent": false, "synchronous": true, "input": { "type": "object", "properties": { "question": { "type": "string" }, "interactionMode": { "type": "string", "enum": ["text", "voice"] } }, "required": ["question","interactionMode"] }, "output": { "type": "string", "description": "Natural language output providing weather information." }, "forms": [ { "op": "invokeaction", "href": "https://weatherai.example.com/weather", "contentType": "application/json", "htv:methodName":"POST" } ] } } } ``` -------------------------------- ### Configure LangChain4J AI Clients Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/05-spring/integration.md This YAML configuration snippet illustrates how to configure different LangChain4J-based AI clients in `application.yml` for the Arc Framework. It includes examples for connecting to local Ollama models, Amazon Bedrock models, and Google Gemini models, specifying their respective connection details and credentials. ```yaml arc: ai: clients: # Ollama (models running locally) - id: llama3:8b modelName: llama3:8b client: ollama # Models hosted on Amazon Bedrock - id: anthropic url: eu-central-1 accessKey: $ACCESS_KEY accessSecret: $ACCESS_SECRET modelName: anthropic.claude-3-5-sonnet-20240620-v1:0 client: bedrock # Gemini - id: gemini modelName: gemini-1.5-flash url: $GEMINI_URL apiKey: $GEMINI_API_KEY client: gemini ``` -------------------------------- ### Enable Graphiql UI (YAML) Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/05-spring/graphql.md Configuration snippet for `application.yml` to enable the Graphiql user interface, a GraphQL IDE, which becomes accessible at `http://localhost:8080/graphiql?path=/graphql` once enabled. ```yaml spring: graphql: graphiql: enabled: true ``` -------------------------------- ### Implement Dynamic Prompt Templating in Arc Agents Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/01-dsl/defining_agents.md This example illustrates how to create dynamic prompts within the Arc Agent DSL using the unary plus operator (`+`). It demonstrates conditional prompt generation based on a `someCondition` and shows how the last string in the `prompt` block is automatically returned without needing the `+` operator, enabling flexible and context-aware prompt construction. ```kts agent { prompt { +"Here is the first part og the prompt." if(someCondition) { +"Here is a conditional part of the prompt." } "The last part of the prompt (this does not require a + because it is automatically returned)." } } ``` -------------------------------- ### Configure Azure OpenAI and OpenAI Clients Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/05-spring/integration.md This YAML configuration snippet demonstrates how to set up various AI clients within `application.yml` for the Arc Framework. It includes examples for connecting to a standard OpenAI model, an Azure OpenAI model using a URL (potentially with Azure Identity), and an Azure OpenAI model using an API key. ```yaml arc: ai: clients: # To connect to an OpenAI Model - id: GPT-4o model-name: gpt-4o api-key: ${OPENAI_API_KEY} client: openai # To connect to an Azure OpenAI Model (requires the Azure Identity library and "az login" to be setup) - id: GPT-4o-Azure model-name: gpt-4o url: ${AZURE_OPENAI_URL} client: azure # To connect to an Azure OpenAI Model with an API Key - id: GPT-4o-Azure-ApiKey model-name: gpt-4o url: ${AZURE_OPENAI_URL} api-key: ${AZURE_API_KEY} client: azure ``` -------------------------------- ### Add Arc Dependencies to Project (Kotlin DSL) Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/05-spring/graphql.md Specifies the necessary Kotlin DSL dependencies to integrate the Arc API, Arc GraphQL Spring Boot Starter, and the recommended Arc Spring Boot Starter into a project's `build.gradle.kts` file. ```kotlin implementation("org.eclipse.lmos:arc-api:$arcVersion") implementation("org.eclipse.lmos:arc-graphql-spring-boot-starter:$arcVersion") implementation("org.eclipse.lmos:arc-spring-boot-starter:$arcVersion") ``` -------------------------------- ### Install Arc CLI on Linux/macOS/WSL Source: https://github.com/eclipse-lmos/website/blob/source/docs/arc/17-cli.md Installs the Arc CLI using the jbang.dev script, adding trust for the Arc repository and installing the arc-runner application. This method is suitable for Linux, macOS, and Windows Subsystem for Linux (WSL) environments. ```bash curl -Ls https://sh.jbang.dev | bash -s - trust add https://github.com/eclipse-lmos/arc/ curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force https://github.com/eclipse-lmos/arc/blob/main/arc-runner/arc.java ``` -------------------------------- ### Example JSON for Unobserving a Property Source: https://github.com/eclipse-lmos/website/blob/source/docs/lmos_protocol/10-communication_protocol.md Provides an example of an `unobserveProperty` message, illustrating how to cease observation of a property ('modelConfiguration') on a Thing. This message is used to stop receiving updates for the specified property. ```json { "thingId": "urn:uuid:3f1d3a7a-4f97-2e6b-c45f-f3c2e1c84c77", "messageId": "abcd1234-5678-90ef-ghij-klmnopqrstuv", "messageType": "unobserveProperty", "name": "modelConfiguration" } ``` -------------------------------- ### Run Gradle Task to Push Helm Chart to OCI Registry Source: https://github.com/eclipse-lmos/website/blob/source/docs/getting_started/03-kotlin_sdk.md This command executes the `helmPush` Gradle task, which publishes the packaged Helm chart to the configured OCI registry. Ensure required environment variables are set before running. ```bash ./gradlew helmPush ```