Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/tool integration #3

Merged
merged 12 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ BEE_FRAMEWORK_LOG_PRETTY=true
BEE_FRAMEWORK_LOG_LEVEL="info"
BEE_FRAMEWORK_LOG_SINGLE_LINE="false"

# Tools
CODE_INTERPRETER_URL=http://127.0.0.1:50051

# For BAM LLM Adapter
# GENAI_API_KEY=

# For Watsonx LLM Adapter
# WATSONX_API_KEY=
# WATSONX_PROJECT_ID=

# For OpenAI LLM Adapter
# OPENAI_API_KEY=

# Image Description Tool
IMAGE_DESC_VLLM_API=https://api.openai.com
IMAGE_DESC_MODEL_ID=llava-hf/llama3-llava-next-8b-hf
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Closes: #

<!-- For completed items, change [ ] to [x]. -->

- [ ] I have read the [contributor guide](https://github.com/i-am-bee/bee-agent-framework/blob/main/CONTRIBUTING.md)
- [ ] I have read the [contributor guide](https://github.com/i-am-bee/bee-community-tools/blob/main/CONTRIBUTING.md)
- [ ] Linting passes: `yarn lint` or `yarn lint:fix`
- [ ] Formatting is applied: `yarn format` or `yarn format:fix`
- [ ] Unit tests pass: `yarn test:unit`
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
yarn lint-staged
CI=true yarn lint && yarn format && yarn ts:check && yarn run test:unit && yarn copyright
CI=true yarn test:unit && yarn copyright
4 changes: 3 additions & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"*.{ts,js}": "eslint --fix",
"*": "prettier --ignore-unknown --write"
"*.ts": "tsc-files --noEmit",
"*": "prettier --ignore-unknown --write",
"!.secrets.baseline": "detect-secrets-hook --baseline .secrets.baseline"
}
85 changes: 85 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"exclude": {
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-09-16T09:06:36Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
},
{
"name": "ArtifactoryDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
},
{
"name": "BasicAuthDetector"
},
{
"name": "BoxDetector"
},
{
"name": "CloudantDetector"
},
{
"ghe_instance": "github.ibm.com",
"name": "GheDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "JwtTokenDetector"
},
{
"keyword_exclude": null,
"name": "KeywordDetector"
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"results": {},
"version": "0.13.1+ibm.62.dss",
"word_list": {
"file": null,
"hash": null
}
}
106 changes: 48 additions & 58 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,85 @@
# Contributing

Bee Agent Framework is an open-source project committed to bringing LLM agents to
people of all backgrounds. This page describes how you can join the Bee
community in this goal.
Bee Agent Framework is an open-source project committed to bringing LLM agents to people of all backgrounds. This page describes how you can join the Bee community in this goal.

## Before you start

If you are new to Bee contributing, we recommend you do the following before diving into the code:

- Read [Bee Overview](./docs/overview.md) to understand core concepts.
- Read [Bee Overview](https://github.com/i-am-bee/bee-agent-framework/blob/main/docs/overview.md) to understand core concepts.
- Read [Code of Conduct](./CODE_OF_CONDUCT.md).

## Choose an issue to work on

Bee uses the following labels to help non-maintainers find issues best suited to their interests and experience level:

- [good first issue](https://github.com/i-am-bee/bee-agent-framework/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) - these issues are typically the simplest available to work on, ideal for newcomers. They should already be fully scoped, with a straightforward approach outlined in the descriptions.
- [help wanted](https://github.com/i-am-bee/bee-agent-framework/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - these issues are generally more complex than good first issues. They typically cover work that core maintainers don't currently have the capacity to implement and may require more investigation/discussion. These are great options for experienced contributors looking for something more challenging.
- [good first issue](https://github.com/i-am-bee/bee-community-tools/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) - these issues are typically the simplest available to work on, ideal for newcomers. They should already be fully scoped, with a straightforward approach outlined in the descriptions.
- [help wanted](https://github.com/i-am-bee/bee-community-tools/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - these issues are generally more complex than good first issues. They typically cover work that core maintainers don't currently have the capacity to implement and may require more investigation/discussion. These are great options for experienced contributors looking for something more challenging.

## Set up a development environment

To start contributing to the Bee Agent framework, follow these steps to set up your development environment:
To start contributing tooling to the Bee Agent framework, follow these steps to set up your development environment:

1. **Install Node Version Manager (NVM):** We use `.nvmrc` to specify the required Node.js version. Install [nvm](https://github.com/nvm-sh/nvm) by following the official installation instructions.
1. **Install a Node Version Manager (NVM or n):** We use `.nvmrc` to specify the required Node.js version. Install [nvm](https://github.com/nvm-sh/nvm) or or [n](https://github.com/tj/n) by following their official installation instructions.

2. **Install the Correct Node.js Version:** Use `nvm` to install and use the Node.js version specified in the `.nvmrc` file:
1. **Install the Correct Node.js Version:** Use `nvm` to install and use the Node.js version specified in the `.nvmrc` file:

```bash
nvm install
nvm use
```
```bash
nvm install && nvm use || n auto
```

3. **Install [Yarn](https://yarnpkg.com/) via Corepack:** This project uses Yarn as the package manager. Ensure you have Corepack enabled and install Yarn:
1. **Install IBM Detect Secrets:** We use [IBM Detect Secrets](https://github.com/IBM/detect-secrets) to help ensure that secrets are not leaked into the code base. This tool is run as part a pre-commit hook so will be required before you can make commits.

```bash
corepack enable
```
1. **Install [Yarn](https://yarnpkg.com/) via Corepack:** This project uses Yarn as the package manager. Ensure you have Corepack enabled and install Yarn:

4. **Install Dependencies:** Install all project dependencies by running:
```bash
corepack enable
```

```bash
yarn install
```
1. **Install Dependencies:** Install all project dependencies by running:

5. **Setup environmental variables:** To run E2E Tests, you should set the following variables in your `.env` file in the repository’s root.
```bash
yarn install
```

```bash
# At least one provider API key must be defined!
GENAI_API_KEY=""
OPENAI_API_KEY=""
WATSONX_API_KEY=""
WATSONX_PROJECT_ID=""
1. **Setup environmental variables:** See the [.env.template](.env.template) file for an example and fill out the appropriate values

WATSONX_SPACE_ID="" # optional
WATSONX_DEPLOYMENT_ID="" # optional
```
```bash
cp .env.template .env
```

6. **Follow Conventional Commit Messages:** We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) to structure our commit messages. This helps maintain a clean and manageable commit history. Please use the following format:
1. **Follow Conventional Commit Messages:** We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) to structure our commit messages. This helps maintain a clean and manageable commit history. Please use the following format:

```
<type>(<scope>): <subject>
Type: feat, fix, chore, docs, style, refactor, perf, test, etc.
Scope: The area of the codebase your changes affect (optional).
Subject: A short description of the changes (required).
```
```
<type>(<scope>): <subject>
Type: feat, fix, chore, docs, style, refactor, perf, test, etc.
Scope: The area of the codebase your changes affect (optional).
Subject: A short description of the changes (required).
```

_Example:_
_Example:_

```
feat(watsonx): add llm streaming support
```
feat(watsonx): add llm streaming support

Ref: #15
```
Ref: #15
```

7. **Run Linters/Formatters:** Ensure your changes meet code quality standards. Run the following commands:
1. **Run Linters/Formatters:** Ensure your changes meet code quality standards. Run the following commands:

```shell
yarn lint # or yarn lint:fix
yarn format # or yarn lint:format
```
```shell
yarn lint # or yarn lint:fix
yarn format # or yarn lint:format
```

8. **Run Tests:** Ensure your changes pass all tests (unit, integration, E2E). Run the following commands:
1. **Run Tests:** Ensure your changes pass all tests (unit, integration, E2E). Run the following commands:

```shell
yarn test:unit
yarn test:e2e
```
```shell
yarn test:unit
yarn test:e2e
```

By following these steps, you'll be all set to contribute to our project! If you encounter any issues during the setup process, please feel free to open an issue.
By following the above steps, you'll be all set to contribute to our project! If you encounter any issues during the setup process, please feel free to open an issue.

## Style and lint

Expand All @@ -102,11 +94,9 @@ Bee uses the following tools to meet code quality standards and ensure a unified
We use GitHub pull requests to accept contributions.

While not required, opening a new issue about the bug you're fixing or the feature you're working on before you open a pull request is important in starting a discussion with the community about your work. The issue gives us a place to talk about the idea and how we can work together to implement it in the code. It also lets the community know what you're working on, and if you need help, you can reference the issue when discussing it with other community and team members.

If you've written some code but need help finishing it, want to get initial feedback on it before finishing it, or want to share it and discuss it prior to completing the implementation, you can open a Draft pull request and prepend the title with the [WIP] tag (for Work In Progress). This will indicate to reviewers that the code in the PR isn't in its final state and will change. It also means we will only merge the commit once it is finished. You or a reviewer can remove the [WIP] tag when the code is ready to be thoroughly reviewed for merging.

## Contributor Licensing Agreement

Before you can submit any code, all contributors must sign a
contributor license agreement (CLA). By signing a CLA, you're attesting
that you are the author of the contribution, and that you're freely
contributing it under the terms of the Apache-2.0 license.
Before you can submit any code, all contributors must sign a contributor license agreement (CLA). By signing a CLA, you're attesting that you are the author of the contribution, and that you're freely contributing it under the terms of the Apache-2.0 license.
72 changes: 32 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,73 @@
<p align="center">
<img src="./docs/assets/Bee_Dark.svg" height="128">
<h1 align="center">Bee Agent Community Tools</h1>
<h1 align="center">Bee Community Tools</h1>
</p>

<p align="center">
<a aria-label="Join the community on GitHub" href="https://github.com/i-am-bee/bee-community-tools/discussions">
<img alt="" src="https://img.shields.io/badge/Join%20the%20community-blueviolet.svg?style=for-the-badge&labelColor=000000&label=Bee">
</a>
<h4 align="center">TODO</h4>
<h4 align="center">Agentic tools that support the Bee Agent Framework</h4>
</p>

TODO
The tools in this repository are additional to those provided within the core bee-agent-framework. They provide access to various functions that enable agents to connect to a variety of different capabilities. More information about developing tools for Bee can be found in the [tools documentation](https://github.com/i-am-bee/bee-agent-framework/blob/main/docs/tools.md).

## Get started with Bee

### Installation
### 🛠️ Tools

```shell
npm install bee-agent-framework bee-community-tools
```
| Name | Description |
| ----------------- | ------------------------------------------------------- |
| Hello World | Trivial example tool |
| Image Description | Use an LLM to get a text description for an image |
| Open Library | Connect to the Open Library for information about books |

or
➕ [Request](https://github.com/i-am-bee/bee-community-tools/discussions)

```shell
yarn add bee-agent-framework bee-community-tools
```
## Getting started with Bee Community Tools

### Example
### Installation

```typescript
// TODO
```shell
yarn install
```

➡️ To run an arbitrary example, use the following command `yarn start -- examples/example.ts` (just pass the appropriate path to the desired example).

### Local Installation (Python Interpreter + Interactive CLI)

> _Note: `yarn` should be installed via Corepack ([tutorial](https://yarnpkg.com/corepack))_

1. Clone the repository `git clone git@github.com:i-am-bee/bee-community-tools`.
2. Install dependencies `yarn install`.
3. Create `.env` (from `.env.template`) and fill in missing values (if any).
4. Run `yarn run start examples/example.ts`.
### Run an example agent with tools

### 🛠️ Tools

TODO
We provide an example agent in `src/index.ts` that you can use to test tools.

## Tutorials
```shell
yarn start
```

🚧 TODO 🚧
The example agent is configured to use a BAM or OpenAI hosted LLM, or a local Ollama LLM.
If you are using a hosted LLM make sure to create .env (from .env.template) and fill in the necessary API_KEY.

## Roadmap
> [!NOTE]
> The Hello World example tool is not enabled by default.

- 🚧 TBD 🚧
> [!TIP]
> Tools can be enabled/disabled in `src/index.ts`

## Contribution guidelines

The Bee Agent Framework is an open-source project and we ❤️ contributions.
Bee Community Tools is an open-source project and we ❤️ contributions.

If you'd like to contribute to Bee, please take a look at our [contribution guidelines](./CONTRIBUTING.md).
If you'd like to contribute to an existing tool or create a new one, please take a look at our [contribution guidelines](./CONTRIBUTING.md).

### Bugs
### 🐛 Bugs

We are using [GitHub Issues](https://github.com/i-am-bee/bee-agent-framework/issues) to manage our public bugs. We keep a close eye on this, so before filing a new issue, please check to make sure it hasn't already been logged.
We are using [GitHub Issues](https://github.com/i-am-bee/bee-community-tools/issues) to manage our public bugs. We keep a close eye on this, so before filing a new issue, please check to make sure it hasn't already been logged.

### Code of conduct
### 🗒 Code of conduct

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

## Legal notice
## 🗒 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.

## Contributors

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

<a href="https://github.com/i-am-bee/bee-community-tools/graphs/contributors">
<img src="https://contrib.rocks/image?repo=i-am-bee/bee-community-tools" />
Expand Down
Loading
Loading