Skip to content

eclipse-lmos/lmos-sample-agents

Folders and files

NameName
Last commit message
Last commit date
Jan 3, 2025
Nov 1, 2024
Jan 10, 2025
Nov 1, 2024
Jan 10, 2025
Jan 10, 2025
Jan 10, 2025
Jan 10, 2025
Jan 10, 2025
Nov 1, 2024
Nov 13, 2024
Nov 1, 2024
Jan 2, 2025
Nov 13, 2024
Nov 1, 2024
Nov 1, 2024
Nov 1, 2024
Nov 12, 2024

Repository files navigation

Java CI with Gradle GitHub Actions Publish Status Apache 2.0 License Contributor Covenant

Welcome to the LMOS Sample Agents Repository

Agents

The following agents are available in this repository:

  • News Agent (news-agent): Retrieves the latest news headlines from a given URL.
  • Weather Agent ('weather-agent`): Retrieves the current weather forecast for a given location.
  • Technical Specifications Agent (techspec-agent): Defines technical specifications from a requirements description.
  • Product Search Agent (productsearch-agent): Searches for products that match given technical specifications.

How to Run

1. Set your OpenAI API Key

The sample agents are set up to use the OpenAI API to access the GPT-4o-mini language model. To use the agents, you need to obtain an API key from OpenAI. You can sign up for an API key at https://platform.openai.com/signup.

Then simply export the API key as an environment variable.

export OPENAI_API_KEY=[YOUR_OPENAI_API_KEY]

2. Start the Application

Choose one of the agents and start it like a normal Spring Boot application. This requires the port 8080 to be available.

  ./gradlew :<[agent-name]>:bootRun

e.g.

  ./gradlew :news-agent:bootRun

for the news agent.

3. Access the Agent

The sample agents are built with Arc and can be accessed via a Graphiql interface. Open http://localhost:8080/graphiql?path=/graphql

Example request for the news agent:

subscription {
    agent(
        request: {
            conversationContext: {
                conversationId: "1"
            }
            systemContext: [],
            userContext: {
                userId: "1234",
                profile: []
            },
            messages: [
                {
                    role: "user",
                    content: "What are the headlines at https://www.theregister.com/ today?",
                    format: "text",
                }
            ]
        }
    ) {
        messages {
            content
        }
    }
}

Code of Conduct

This project has adopted the Contributor Covenant in version 2.1 as our code of conduct. Please see the details in our CODE_OF_CONDUCT.md. All contributors must abide by the code of conduct.

By participating in this project, you agree to abide by its Code of Conduct at all times.

Licensing

This project follows the REUSE standard for software licensing.
Each file contains copyright and license information, and license texts can be found in the ./LICENSES folder. For more information visit https://reuse.software/.
You can find a guide for developers at https://telekom.github.io/reuse-template/.