Skip to content

Commit

Permalink
style: enable eslint for markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas2D committed Aug 29, 2024
1 parent ea28b43 commit f4ed0d8
Show file tree
Hide file tree
Showing 8 changed files with 716 additions and 84 deletions.
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,8 +24,9 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots or code snippets to help explain your problem.

**Set-up:**
- Bee version: [e.g. v0.0.3]
- Model provider [e.g. watsonx]

- Bee version: [e.g. v0.0.3]
- Model provider [e.g. watsonx]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<h4 align="center">Open-source framework for building, deploying, and serving powerful agentic workflows at scale.</h4>
</p>



The Bee framework makes it easy to build agentic worfklows with leading open-source and proprietary models. We’re working on bringing model-agnostic support to any LLM to help developers avoid model provider lock-in.

## Key Features
Expand Down
84 changes: 42 additions & 42 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

The source directory (`src`) provides numerous modules that one can use.

| Name | Description |
| -------------- |--------------------------------------------------------------------------------------------|
| **agents** | Base classes defining the common interface for agent. |
| **llms** | Base classes defining the common interface for text inference (standard or chat). |
| **template** | Prompt Templating system based on `Mustache` with various improvements_. |
| **memory** | Various types of memories to use with agent. |
| **tools** | Tools that an agent can use. |
| **cache** | Preset of different caching approaches that can be used together with tools. |
| **errors** | Base framework error classes used by each module. |
| **adapters** | Concrete implementations of given modules for different environments. |
| **logger** | Core component for logging all actions within the framework. |
| Name | Description |
| -------------- | ------------------------------------------------------------------------------------------- |
| **agents** | Base classes defining the common interface for agent. |
| **llms** | Base classes defining the common interface for text inference (standard or chat). |
| **template** | Prompt Templating system based on `Mustache` with various improvements\_. |
| **memory** | Various types of memories to use with agent. |
| **tools** | Tools that an agent can use. |
| **cache** | Preset of different caching approaches that can be used together with tools. |
| **errors** | Base framework error classes used by each module. |
| **adapters** | Concrete implementations of given modules for different environments. |
| **logger** | Core component for logging all actions within the framework. |
| **serializer** | Core component for the ability to serialize/deserialize modules into the serialized format. |
| **version** | Constants representing the framework (e.g., latest version) |
| **internals** | Modules used by other modules within the framework. |
| **version** | Constants representing the framework (e.g., latest version) |
| **internals** | Modules used by other modules within the framework. |

### Emitter

Expand All @@ -29,8 +29,8 @@ An emitter is a core functionality of the framework that gives you the ability t
import { Emitter, EventMeta } from "@/emitter/emitter.js";

Emitter.root.match("*.*", (data: unknown, event: EventMeta) => {
console.info(event.path, { data })
})
console.info(event.path, { data });
});
```

🚧 TBD
Expand Down Expand Up @@ -75,13 +75,13 @@ This enables the agent to maintain context over time, improve its responses base

The framework provides out-of-the-box following types of memories.

| Name | Description |
| --------------------- | -------------------------------------------------------------------------------------------------------------- |
| `UnconstrainedMemory` | Unlimited size. It is suitable if your context window is huge. |
| `SlidingWindowMemory` | Keeps last `k` messages in the memory. The oldest ones are deleted. |
| `TokenMemory` | Ensures that the number of tokens of all messages is below the given threshold. The oldest are removed. |
| `SummarizeMemory` | Only a single summarization of the conversation is preserved. Summarization is updated with every new message. |
|[Request](https://github.com/i-am-bee/bee-agent-framework/discussions) | |
| Name | Description |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `UnconstrainedMemory` | Unlimited size. It is suitable if your context window is huge. |
| `SlidingWindowMemory` | Keeps last `k` messages in the memory. The oldest ones are deleted. |
| `TokenMemory` | Ensures that the number of tokens of all messages is below the given threshold. The oldest are removed. |
| `SummarizeMemory` | Only a single summarization of the conversation is preserved. Summarization is updated with every new message. |
|[Request](https://github.com/i-am-bee/bee-agent-framework/discussions) | |

### Tools

Expand All @@ -92,17 +92,17 @@ These tools extend the agent's abilities, allowing it to interact with external

The framework provides out-of-the-box tools.

| Name | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `PythonTool` | Run arbitrary Python code in the remote environment. |
| `WikipediaTool` | Search for data on Wikipedia. |
| `DuckDuckGoTool` | Search for data on DuckDuckGo. |
| `LLMTool` | Uses an LLM to process input data. |
| `DynamicTool` | Construct to create dynamic tools. |
| `ArXivTool` | Retrieves research articles published on arXiv. |
| `WebCrawlerTool` | Retrieves content of an arbitrary website. |
| `CustomTool` | Runs your own Python function in the remote environment. |
| `OpenMeteoTool` | Retrieves current, previous, or upcoming weather for a given destination. |
| Name | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `PythonTool` | Run arbitrary Python code in the remote environment. |
| `WikipediaTool` | Search for data on Wikipedia. |
| `DuckDuckGoTool` | Search for data on DuckDuckGo. |
| `LLMTool` | Uses an LLM to process input data. |
| `DynamicTool` | Construct to create dynamic tools. |
| `ArXivTool` | Retrieves research articles published on arXiv. |
| `WebCrawlerTool` | Retrieves content of an arbitrary website. |
| `CustomTool` | Runs your own Python function in the remote environment. |
| `OpenMeteoTool` | Retrieves current, previous, or upcoming weather for a given destination. |
|[Request](https://github.com/i-am-bee/bee-agent-framework/discussions) | |

To create your own tool, you need to either implement the `BaseTool` class ([example](../examples/tools/customHttpRequest.ts)) or use `DynamicTool.`
Expand All @@ -118,13 +118,13 @@ The primary purpose of caching is to improve the efficiency and performance of s

The framework provides out-of-the-box following cache implementations.

| Name | Description |
|----------------------|--------------------------------------------------------------------|
| `UnconstrainedCache` | Unlimited size. |
| `FileCache` | Saves/Loads entries to/from a file. |
| `SlidingCache` | Keeps last `k` entries in the memory. The oldest ones are deleted. |
| `NullCache` | Disables caching. |
|[Request](https://github.com/i-am-bee/bee-agent-framework/discussions) | |
| Name | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `UnconstrainedCache` | Unlimited size. |
| `FileCache` | Saves/Loads entries to/from a file. |
| `SlidingCache` | Keeps last `k` entries in the memory. The oldest ones are deleted. |
| `NullCache` | Disables caching. |
|[Request](https://github.com/i-am-bee/bee-agent-framework/discussions) | |

To create your cache implementation, you must implement the `BaseCache` class.

Expand All @@ -134,7 +134,7 @@ To create your cache implementation, you must implement the `BaseCache` class.
> Note: We guarantee that every framework-related error is an instance of the `FrameworkError` class.
🚧 TBD
🚧 TBD

### Logger

Expand All @@ -151,7 +151,7 @@ import { Logger, LoggerLevel } from "bee-agent-framework/logger";

Logger.defaults.pretty = true; // (override default settings)
const root = Logger.root; // get root logger
root.level = LogerLevel.WARN; // update the logger level (default is LoggerLevel.INFO)
root.level = LoggerLevel.WARN; // update the logger level (default is LoggerLevel.INFO)
```

Some of the `Logger` defaults can be controlled via the following environmental variables.
Expand Down
19 changes: 18 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
// @ts-check

// @ts-expect-error missing types
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import prettierConfig from "eslint-config-prettier";
import unusedImports from "eslint-plugin-unused-imports";
import markdown from "@eslint/markdown";

export default tseslint.config(
{
ignores: ["node_modules/**", "dist/**"],
},
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
{
ignores: ["**/*.js"],
files: ["**/*.md/**"],
languageOptions: {
parserOptions: {
project: null,
},
},
rules: {
"@typescript-eslint/no-unused-vars": "off",
},
},
{
ignores: ["**/*.md/**"],
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
Expand Down Expand Up @@ -60,6 +76,7 @@ export default tseslint.config(
"unused-imports/no-unused-vars": "off",
},
},
...markdown.configs.processor,

Check failure on line 79 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Lint & Build

'markdown.configs' is possibly 'undefined'.

Check failure on line 79 in eslint.config.js

View workflow job for this annotation

GitHub Actions / Lint & Build

Type 'LegacyConfig<RulesRecord, RulesRecord> | Config<RulesRecord> | Config<RulesRecord>[]' must have a '[Symbol.iterator]()' method that returns an iterator.
prettierConfig,
{
rules: {
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"infra:start-code-interpreter": "yarn _docker compose up bee-code-interpreter",
"infra:stop-all": "yarn _docker compose down",
"infra:clean-all": "yarn _docker compose down --volumes",
"lint": "yarn eslint src examples",
"lint:fix": "yarn eslint --fix src examples",
"format": "yarn prettier --check src examples",
"format:fix": "yarn prettier --write src examples",
"lint": "yarn eslint",
"lint:fix": "yarn eslint --fix",
"format": "yarn prettier --check .",
"format:fix": "yarn prettier --write .",
"test:unit": "vitest run src",
"test:unit:watch": "vitest run src",
"test:e2e": "vitest run tests",
Expand Down Expand Up @@ -116,15 +116,16 @@
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@eslint/js": "^9.9.0",
"@eslint/markdown": "^6.0.0",
"@ibm-generative-ai/node-sdk": "~3.2.1",
"@langchain/community": "~0.2.28",
"@langchain/core": "~0.2.27",
"@langchain/langgraph": "~0.0.34",
"@release-it/conventional-changelog": "^8.0.1",
"@rollup/plugin-commonjs": "^26.0.1",
"@swc/core": "^1.7.14",
"@types/eslint": "^9.6.1",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@types/mustache": "^4",
"@types/needle": "^3.3.0",
"@types/node": "^20.16.1",
Expand Down
Loading

0 comments on commit f4ed0d8

Please sign in to comment.