-
Notifications
You must be signed in to change notification settings - Fork 29
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
PR: correct discrepancies with the old bot #55
Changes from all commits
101d176
264869f
395d154
63b9201
2e5c541
725e060
b90e8c6
77ce558
a22defd
1ca68d0
8a5a3ef
4e6ae91
c6050d4
0c063a8
cd5b4d0
708db4e
4689208
4d574b8
9f8815e
16d6c61
6f014f4
5f9cf62
292cca5
087090e
64f2f57
7d6a75b
3835202
f468888
0eb37d3
453eac9
324234f
135105d
8ea2713
6b512c5
7206411
92cbfb1
de942ee
ee14b90
238f4d0
0917a07
50a4380
c0c5ce7
ac4b164
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
output.html | ||
tests/__mocks__/results/output-reward-split.html |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
# `@ubiquibot/conversation-rewards` | ||
|
||
This is intended to be the proper implementation of comment incentives, based on our learnings from the first go-around. | ||
As of 28 February: test driven development to aggregate all necessary information based on a URL to an issue. | ||
|
||
As of 28 February: test driven development to aggregate all necessary information based on a URL to an issue. | ||
- pass in closed as complete issue URL and receive all the timeline events and activities of all humans who helped close the issue as complete. | ||
- most importantly: this can inherit bot authentication and link pull requests to issues in private repositories. | ||
- pass in closed as complete issue URL and receive all the timeline events and activities of all humans who helped close the issue as complete. | ||
- most importantly: this can inherit bot authentication and link pull requests to issues in private repositories. | ||
|
||
Be sure to review all `*.test.*` files for implementation details. | ||
Be sure to review all `*.test.*` files for implementation details. | ||
|
||
## Data structure | ||
|
||
|
@@ -36,8 +35,9 @@ Be sure to review all `*.test.*` files for implementation details. | |
}, | ||
"reward": 0.8, | ||
"relevance": 0.5 | ||
} | ||
} | ||
}] | ||
] | ||
} | ||
} | ||
``` | ||
|
@@ -48,70 +48,80 @@ Reward formula: `((count * wordValue) * (score * formattingMultiplier) * n) * re | |
|
||
Here is a possible valid configuration to enable this plugin. See [these files](./src/configuration) for more details. | ||
|
||
|
||
```yaml | ||
plugin: ubiquibot/conversation-rewards | ||
with: | ||
evmNetworkId: 100 | ||
evmPrivateEncrypted: "encrypted-key" | ||
erc20RewardToken: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d" | ||
dataCollection: | ||
maxAttempts: 10 | ||
delayMs: 10000 | ||
incentives: | ||
requirePriceLabel: true | ||
contentEvaluator: | ||
userExtractor: | ||
redeemTask: true | ||
dataPurge: | ||
formattingEvaluator: | ||
scores: | ||
br: 0 | ||
code: 1 | ||
p: 1 | ||
em: 0 | ||
img: 0 | ||
strong: 0 | ||
blockquote: 0 | ||
h1: 1 | ||
h2: 1 | ||
h3: 1 | ||
h4: 1 | ||
h5: 1 | ||
h6: 1 | ||
a: 1 | ||
li: 1 | ||
td: 1 | ||
hr: 0 | ||
evmNetworkId: 100 | ||
evmPrivateEncrypted: "encrypted-key" | ||
erc20RewardToken: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d" | ||
dataCollection: | ||
maxAttempts: 10 | ||
delayMs: 10000 | ||
incentives: | ||
requirePriceLabel: true | ||
contentEvaluator: | ||
multipliers: | ||
- select: [ISSUE_SPECIFICATION] | ||
relevance: 1 | ||
- select: [PULL_AUTHOR] | ||
relevance: 1 | ||
- select: [PULL_ASSIGNEE] | ||
relevance: 1 | ||
- select: [PULL_COLLABORATOR] | ||
relevance: 1 | ||
- select: [PULL_CONTRIBUTOR] | ||
relevance: 1 | ||
userExtractor: | ||
redeemTask: true | ||
Comment on lines
+74
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this? We should just make it a single property without nesting probably. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The nesting is die to |
||
dataPurge: | ||
formattingEvaluator: | ||
scores: | ||
br: 0 | ||
code: 1 | ||
p: 1 | ||
em: 0 | ||
img: 0 | ||
strong: 0 | ||
blockquote: 0 | ||
h1: 1 | ||
h2: 1 | ||
h3: 1 | ||
h4: 1 | ||
h5: 1 | ||
h6: 1 | ||
a: 1 | ||
li: 1 | ||
td: 1 | ||
hr: 0 | ||
multipliers: | ||
- select: [ ISSUE_SPECIFICATION ] | ||
- select: [ISSUE_SPECIFICATION] | ||
formattingMultiplier: 1 | ||
wordValue: 0.1 | ||
- select: [ ISSUE_AUTHOR ] | ||
- select: [ISSUE_AUTHOR] | ||
formattingMultiplier: 1 | ||
wordValue: 0.2 | ||
- select: [ ISSUE_ASSIGNEE ] | ||
- select: [ISSUE_ASSIGNEE] | ||
formattingMultiplier: 0 | ||
wordValue: 0 | ||
- select: [ ISSUE_COLLABORATOR ] | ||
- select: [ISSUE_COLLABORATOR] | ||
formattingMultiplier: 1 | ||
wordValue: 0.1 | ||
- select: [ ISSUE_CONTRIBUTOR ] | ||
- select: [ISSUE_CONTRIBUTOR] | ||
formattingMultiplier: 0.25 | ||
wordValue: 0.1 | ||
- select: [ PULL_SPECIFICATION ] | ||
- select: [PULL_SPECIFICATION] | ||
formattingMultiplier: 0 | ||
wordValue: 0 | ||
- select: [ PULL_AUTHOR ] | ||
- select: [PULL_AUTHOR] | ||
formattingMultiplier: 2 | ||
wordValue: 0.2 | ||
- select: [ PULL_ASSIGNEE ] | ||
- select: [PULL_ASSIGNEE] | ||
formattingMultiplier: 1 | ||
wordValue: 0.1 | ||
- select: [ PULL_COLLABORATOR ] | ||
- select: [PULL_COLLABORATOR] | ||
formattingMultiplier: 1 | ||
wordValue: 0.1 | ||
- select: [ PULL_CONTRIBUTOR ] | ||
- select: [PULL_CONTRIBUTOR] | ||
formattingMultiplier: 0.25 | ||
wordValue: 0.1 | ||
permitGeneration: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
import { Static, Type } from "@sinclair/typebox"; | ||
import { commentType } from "./formatting-evaluator-config"; | ||
|
||
export const contentEvaluatorConfigurationType = Type.Object({}); | ||
export const contentEvaluatorConfigurationType = Type.Object({ | ||
/** | ||
* Multipliers applied to different types of comments | ||
*/ | ||
multipliers: Type.Array( | ||
Type.Object({ | ||
select: Type.Array(commentType), | ||
relevance: Type.Optional(Type.Number()), | ||
}), | ||
{ | ||
default: [ | ||
{ | ||
select: ["ISSUE_SPECIFICATION"], | ||
relevance: 1, | ||
}, | ||
{ | ||
select: ["PULL_AUTHOR"], | ||
relevance: 1, | ||
}, | ||
{ | ||
select: ["PULL_ASSIGNEE"], | ||
relevance: 1, | ||
}, | ||
{ | ||
select: ["PULL_COLLABORATOR"], | ||
relevance: 1, | ||
}, | ||
{ | ||
select: ["PULL_CONTRIBUTOR"], | ||
relevance: 1, | ||
}, | ||
], | ||
} | ||
), | ||
}); | ||
|
||
export type ContentEvaluatorConfiguration = Static<typeof contentEvaluatorConfigurationType>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sets these to relevance 1? This is not clear to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requirement was to set the relevance of issue specifications, and PR comments to 1. To implement that I added something called "Fixed Relevance" and you can specify it in config. You can add fixed relevance to any comment type, and if you do so, fixed relevance will take precedence and that comment type will not be sent to OpenAI for evaluation, and the fixed relevance will be applied to that comment type. What you see in the readme file above are fixed relevance of 1 being applied to issue specifications and PR comments.