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(plugin) add ai-history plugin #1224

Merged
merged 9 commits into from
Aug 27, 2024
Merged

feat(plugin) add ai-history plugin #1224

merged 9 commits into from
Aug 27, 2024

Conversation

yuemingming
Copy link
Contributor

Ⅰ. Describe what this PR did

实现 ai-history 插件,支持自动填充历史对话,以及查询历史对话。

Ⅱ. Does this pull request fix one issue?

fixes #1193

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@CLAassistant
Copy link

CLAassistant commented Aug 18, 2024

CLA assistant check
All committers have signed the CLA.

plugins/wasm-go/extensions/ai-history/README.md Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/README.md Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
@hanxiantao
Copy link
Collaborator

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

sakura seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@yuemingming 这个记得处理下

@yuemingming yuemingming reopened this Aug 19, 2024
@yuemingming
Copy link
Contributor Author

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
sakura seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@yuemingming 这个记得处理下

Done

@hanxiantao hanxiantao self-requested a review August 19, 2024 23:49
plugins/wasm-go/extensions/ai-history/main.go Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
@johnlanni
Copy link
Collaborator

@yuemingming 加一下我钉钉:chengtanzty

@hanxiantao
Copy link
Collaborator

可能还需要考虑下如何兼容OpenAI的多模态的协议

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What'\''s in this image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
            }
          }
        ]
      }
    ],
    "max_tokens": 300
  }'

请求里content字段是数组 可以参考下 #1221 里的处理

或者后续我这边完善下这块也可以

@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.34%. Comparing base (ef31e09) to head (29ed055).
Report is 63 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1224      +/-   ##
==========================================
+ Coverage   35.91%   44.34%   +8.43%     
==========================================
  Files          69       75       +6     
  Lines       11576     9821    -1755     
==========================================
+ Hits         4157     4355     +198     
+ Misses       7104     5139    -1965     
- Partials      315      327      +12     

see 90 files with indirect coverage changes

plugins/wasm-go/extensions/ai-history/README.md Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Outdated Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Show resolved Hide resolved
plugins/wasm-go/extensions/ai-history/main.go Show resolved Hide resolved
Copy link
Collaborator

@johnlanni johnlanni left a comment

Choose a reason for hiding this comment

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

LGTM

@johnlanni johnlanni merged commit 75e1def into alibaba:main Aug 27, 2024
12 checks passed
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.

Implement AI-history plugin
6 participants