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

小说推文AgentExample #935

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LinightKira
Copy link

@LinightKira LinightKira commented Feb 26, 2024

Features

小说转视频Agent工作步骤
1、获取小说(示例中直接贴小说到代码里,可外接数据库Or从文档获取)
2、改写
3、分段/分镜
4、生成SD提示词
5、TTS语言合成
6、SD文生图
7、合成视频

Feature Docs

Influence

Result

Other

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.19%. Comparing base (06d7269) to head (b47a668).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #935   +/-   ##
=======================================
  Coverage   81.19%   81.19%           
=======================================
  Files         226      226           
  Lines       12477    12477           
=======================================
  Hits        10131    10131           
  Misses       2346     2346           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@geekan geekan requested a review from garylin2099 March 1, 2024 09:53
self.title = title
self.content = content

def GetNovelById(nid):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数命名需要改成snake case命名,比如get_novel_by_id,单词之间用下划线 _ 分隔,并且所有字母都是小写的


def GetNovelById(nid):
# return Novel.query.get(nid) #此处可以对接到数据库
print('nid:', nid)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

日志用metagpt.logs的logger来打印。

from metagpt.logs import logger

logger.debug("xxx")
logger.info("xxx")
logger.warning("xxx")

return resp


async def main():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用单元测试代替这个main()



# SD_t2i SD文生图
class SD_t2i(Action):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类名用驼峰方式

print('segment resp:', resp)
# 更新总分镜个数
self.total_storyboard.append(len(resp))
print('length', self.total_storyboard[self.current_chapter_number])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print换成logger.debug/info

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件名采用snake case方式: file_tools.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants