Skip to content

[WIP] Add support for more data types: JSON, URL, text - #922

Closed
hustcc with Copilot wants to merge 1 commit into
aifrom
copilot/add-support-for-json-url-text
Closed

[WIP] Add support for more data types: JSON, URL, text#922
hustcc with Copilot wants to merge 1 commit into
aifrom
copilot/add-support-for-json-url-text

Conversation

Copilot AI commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

Implementation Plan for New Data Types Support

  • 1. Add loadObject() method for JSON Object support

    • Implement method in src/data/index.ts
    • Add method to AVA class in src/ava.ts
    • Add unit tests in __tests__/data.test.ts
    • Add example in examples/
  • 2. Add loadURL() method for URL data fetching

    • Implement method in src/data/index.ts with fetch support
    • Add method to AVA class in src/ava.ts
    • Add unit tests in __tests__/data.test.ts
    • Add example in examples/
  • 3. Add loadText() method for text-to-structured data

    • Implement method in src/data/index.ts using LLM
    • Add method to AVA class in src/ava.ts
    • Add unit tests in __tests__/data.test.ts
    • Add example in examples/
  • 4. Update exports and types

    • Export new methods from src/index.ts
    • Add any necessary type definitions
  • 5. Final validation

    • Run all tests
    • Build the project
    • Verify examples work

Note: Keeping changes minimal and focused on the data import module

Original prompt

This section details on the original issue you should resolve

<issue_title>支持更多的数据类型:JSON,Url,文本</issue_title>
<issue_description>### 背景

当前 ava 4.0 已经支持了结构化数据 csv,整体测试下来流程是通的,且对大小数据都能分析数据成功。但是对于数据来源种类,还不够。

设计

计划支持:

  1. JSON Object 直接传入需要被分析的结构化数据
ava.loadObject([{ /*...*/ }]);
  1. Url,从 url 结果中过去有效的数据,并作为需要被分析的数据
ava.loadURL('https://xxx', (response) => response.dataObject);

传入 url 地址,以及对于 response 回调处理,获取正确的数据。默认回调函数为 response => response

  1. 从文本导入数据,需要通过 ai 从非结构化数据中抽出合理合适的结构化数据,作为被分析的对象
ava.loadText('杭州 100,上海 200,北京 300'); // 返回结构化数据,供分析

如果还有其他可支持,给我一些建议。

要求

  1. 主要是改造数据导入的模块和 API,尽量要动其他的代码。
  2. 合适的位置增加单元测试
  3. 在 examples 中增加一些案例
  4. 保持代码简洁,精炼
    </issue_description>

<agent_instructions>按照 issue 描述,帮我实现一下功能。</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@hustcc hustcc closed this Jan 30, 2026
Copilot AI requested a review from hustcc January 30, 2026 04:53
Copilot stopped work on behalf of hustcc due to an error January 30, 2026 04:53
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.

支持更多的数据类型:JSON,Url,文本

2 participants