npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bee-observe-connector

v0.0.6

Published

LLM Agent Framework and Observe connector

Downloads

687

Readme

This package allows you to easily join the Bee Agent Framework and Bee Observe with the one exported function.

Table of Contents

  1. 👩‍💻 Get started with Observe
  1. 🪑 Local set-up
  1. 🚀 Run
  1. 🧪 Run tests
  2. Code of conduct
  3. Legal notice
  4. 📖 Docs

Getting started

Installation

npm install bee-observe-connector

or

yarn add bee-observe-connector

Usage

import { BeeAgent } from "bee-agent-framework/agents/bee/agent";
import { OllamaChatLLM } from "bee-agent-framework/adapters/ollama/chat";
import { TokenMemory } from "bee-agent-framework/memory/tokenMemory";
import { DuckDuckGoSearchTool } from "bee-agent-framework/tools/search/duckDuckGoSearch";
import { OpenMeteoTool } from "bee-agent-framework/tools/weather/openMeteo";
import { createObserveConnector } from "bee-observe-connector";

const llm = new OllamaChatLLM(); // default is llama3.1 (8B), it is recommended to use 70B model

const agent = new BeeAgent({
  llm,
  memory: new TokenMemory({ llm }),
  tools: [new DuckDuckGoSearchTool(), new OpenMeteoTool()],
});

const prompt = "What's the current weather in Las Vegas?";

await agent
  .run({ prompt })
  .middleware(createObserveConnector({
    api: {
      baseUrl: 'http://localhost:3001',
      apiAuthKey: 'xxx'
    },
    cb: async (err, data) => {
      if (err) {
        if (err instanceof ObserveError) {
          console.log(err.explain());
        } else {
          console.error(err);
        }
      } else {
        console.log(data);
      }
    },
  }));

For more information about Agent setting see the Bee Agent Framework README.md file or go to the Run examples section.

Limitations

  • Max request time 10s = The connector sends the trace data to the Observe API. It uses the signal propagated from the Framework and the default signal with a timeout of 10 seconds.

Local set-up

Prerequisites

  • Node.js (version managed using nvm)
  • Yarn package manager (corepack)
  • Git
  • Docker distribution with support for compose is required, the following are supported:
    • Docker
    • Rancher - macOS users may want to use VZ instead of QEMU
    • Podman - requires compose and rootful machine (if your current machine is rootless, please create a new one)

Steps

  1. Clone the repository:
git clone [email protected]:i-am-bee/bee-observe-connector.git
cd bee-observe-connector
  1. Use the appropriate Node.js version:
nvm use
  1. Install dependencies
yarn
  1. Run infra To start all necessary services like observe API, redis, mongo and mlflow run this command:
yarn start:infra

🚀 Run

Run examples

Base example:

yarn start:base

🧪 Run tests

yarn test:unit
yarn test:e2e

For the test coverage:

yarn coverage

Code of conduct

This project and everyone participating in it are governed by the Code of Conduct. By participating, you are expected to uphold this code. Please read the full text so that you can read which actions may or may not be tolerated.

Legal notice

All content in these repositories including code has been provided by IBM under the associated open source software license and IBM is under no obligation to provide enhancements, updates, or support. IBM developers produced this code as an open source project (not as an IBM product), and IBM makes no assertions as to the level of quality nor security, and will not be maintaining this code going forward.

📖 Docs

Read all related document pages carefully to understand the Observer API architecture and limitations.

Contributors

Special thanks to our contributors for helping us improve Bee Agent Framework.