Skip to content

Commit 51b4cf5

Browse files
authored
fix: update credit system logic (#894)
Merged PR #894 - Updated credit system logic in core credit module
2 parents de52d2a + 82bbe67 commit 51b4cf5

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## v0.8.18
2+
3+
### Features
4+
- Updated OpenAI image generation skills configuration
5+
- Enhanced image generation capabilities
6+
7+
### Changes
8+
- Updated `intentkit/skills/openai/gpt_avatar_generator.py`
9+
- Updated `intentkit/skills/openai/gpt_image_mini_generator.py`
10+
- Added changelog documentation
11+
12+
**Full Changelog**: https://github.com/crestalnetwork/intentkit/compare/v0.8.17...v0.8.18
13+
114
## v0.8.17
215

316
### Features

intentkit/core/credit.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,16 +1285,16 @@ async def skill_cost(
12851285
skill = await Skill.get(skill_name)
12861286
if not skill:
12871287
raise ValueError(f"The price of {skill_name} not set yet")
1288-
agent_skill_config = agent.skills.get(skill.category)
1289-
if (
1290-
agent_skill_config
1291-
and agent_skill_config.get("api_key_provider") == "agent_owner"
1292-
):
1293-
base_skill_amount = skill.price_self_key.quantize(
1294-
FOURPLACES, rounding=ROUND_HALF_UP
1295-
)
1296-
else:
1297-
base_skill_amount = skill.price.quantize(FOURPLACES, rounding=ROUND_HALF_UP)
1288+
base_skill_amount = skill.price.quantize(FOURPLACES, rounding=ROUND_HALF_UP)
1289+
if agent.skills:
1290+
agent_skill_config = agent.skills.get(skill.category)
1291+
if (
1292+
agent_skill_config
1293+
and agent_skill_config.get("api_key_provider") == "agent_owner"
1294+
):
1295+
base_skill_amount = skill.price_self_key.quantize(
1296+
FOURPLACES, rounding=ROUND_HALF_UP
1297+
)
12981298
# Get payment settings
12991299
payment_settings = await AppSetting.payment()
13001300

0 commit comments

Comments
 (0)