34 Commits

Author SHA1 Message Date
Han Xiao
45bcbf958e feat: only hostnames 2025-03-24 10:50:19 +08:00
Han Xiao
7d07078ec5 feat: only hostnames 2025-03-24 10:41:35 +08:00
Han Xiao
f5d6bf75f5 feat: add num urls 2025-03-14 15:18:50 +08:00
Han Xiao
980549020e fix: eval 2025-03-11 18:00:45 +08:00
Han Xiao
8400684637 fix: eval 2025-03-11 16:56:34 +08:00
Han Xiao
d947973a68 refactor: query rewriter 2025-03-11 15:10:08 +08:00
Han Xiao
6ab0cef126 fix: url datetime guessing 2025-03-11 11:26:05 +08:00
Han Xiao
79542148d8 fix: search and query expand 2025-03-03 21:51:27 +08:00
Han Xiao
dbc8a30fd4 feat: add api params 2025-02-28 22:17:36 +08:00
Han Xiao
66490f3848 refactor: schemas 2025-02-25 15:12:19 +08:00
Han Xiao
ad7e524554 fix: multi-aspect 2025-02-25 11:12:33 +08:00
Han Xiao
c02588a92c feat: optimize prompt, coding, reflect 2025-02-24 13:16:18 +08:00
Han Xiao
c8cd9bc09e fix: overlength gen 2025-02-22 11:28:25 +08:00
Han Xiao
528a6343e2 fix: overlength gen 2025-02-22 00:28:10 +08:00
Han Xiao
6d7d0b9e20 fix: optimize prompt 2025-02-15 14:36:16 +08:00
Han Xiao
bd77535dd9
refactor: add safe obj generation (#60)
* fix: broken markdown footnote

* refactor: safe obj generation

* test: update token tracking assertions to match new implementation

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: safe obj generation

* chore: update readme

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-02-13 00:33:58 +08:00
Han Xiao
41ee1812db fix: token tracking 2025-02-12 11:20:49 +08:00
Han Xiao
fa05e53307 feat: improve search action 2025-02-07 12:35:27 +08:00
devin-ai-integration[bot]
50dff0863c
feat: add OpenAI provider with structured output support (#28)
* feat: add OpenAI provider with structured output support

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: add @ai-sdk/openai dependency and fix modelConfigs access

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: correct indentation in agent.ts

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: centralize model initialization in config.ts

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: improve model config access patterns

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove unused imports

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: clean up

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-02-06 15:05:38 +08:00
devin-ai-integration[bot]
f1c7ada6ae
refactor: replace @google/generative-ai with @ai-sdk/google (#27)
* refactor: replace @google/generative-ai with @ai-sdk/google

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: use createGoogleGenerativeAI for API key configuration

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update Zod schemas to use discriminated unions

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: ensure at least one variant in Zod discriminated union

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove unused actions variable

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove duplicate sections declaration and update action sections

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update schema types and use process.env.GEMINI_API_KEY

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update schema to use z.union with type literal

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: restore original schema descriptions and remove unused imports

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update schema to use discriminatedUnion with proper descriptions

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update schema to use proper type casting for discriminated union

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update schema type casting for discriminated union

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update schema to use strict mode and proper type definitions

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: add type field to all schemas

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove unused schema variables

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove unused baseSchema variable

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove unused baseSchema variable and comments

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: implement token tracking using generateObject response

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update token tracking to use proper destructuring

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: implement token tracking in evaluator and add test

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: move maxTokens parameter to config.ts

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* feat: implement error handling for generateObject schema validation errors

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove lint errors in error handling utility

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* chore: clean up error handling utility

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove unused functionName parameter

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: remove functionName parameter from handleGenerateObjectError calls

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: update DedupResponse import to type import

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: clean up

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-02-06 14:14:12 +08:00
Han Xiao
2306bd3a9e fix: improve prompting 2025-02-05 13:48:05 +08:00
Han Xiao
fd40c7b020 fix: improve prompting 2025-02-05 12:11:41 +08:00
Han Xiao
77e1656744 fix: remove unnecessary budget guard 2025-02-05 10:45:20 +08:00
Han Xiao
70a3eef522 fix: remove unnecessary budget guard 2025-02-05 10:43:08 +08:00
devin-ai-integration[bot]
5be008e8b9
feat: add action tracker and reset token tracker (#8)
* feat: add action tracker and reset token tracker

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: make trackers request-scoped

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-02-02 23:25:54 +08:00
devin-ai-integration[bot]
ca0f780cc3
feat: add web server wrapper for getResponse (#6)
* feat: add web server wrapper for getResponse

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* chore: update package-lock.json

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* fix: add proper types to Express route handlers

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: update API endpoint path and request parameters

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: centralize model configurations with per-tool settings

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: update agent.ts to use centralized model configuration

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-02-02 22:07:43 +08:00
devin-ai-integration[bot]
c793cb9bbc
refactor: consolidate type definitions into types.ts (#5)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-02-02 20:53:28 +08:00
Han Xiao
193d982ed9 chore: first commit 2025-02-02 17:14:28 +08:00
devin-ai-integration[bot]
f99608909c
refactor: centralize token tracking and clean up console output (#3)
* refactor: centralize token tracking and clean up console output

- Remove manual token tracking in agent.ts
- Track tokens through tokenTracker.trackUsage()
- Clean up verbose console output
- Add ESLint configuration
- Fix TypeScript linting issues

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: simplify sleep function and use console.log consistently

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: remove color modifiers from console.log statements

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-01-31 15:25:28 +08:00
devin-ai-integration[bot]
966ef5d026
Refactor Tools to Use config.ts (#2)
* refactor: remove redundant code and use config imports

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: standardize token tracking in search and read tools

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* refactor: standardize console logging with colors and levels

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* feat: add centralized token tracking utility

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* feat: integrate token tracking across all tools

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

* feat: add token tracking and colored console output to agent

Co-Authored-By: Han Xiao <han.xiao@jina.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
2025-01-31 14:52:41 +08:00
Devin AI
738af73010 feat: improve token tracking and centralize config
- Add centralized config.ts for API keys and model settings
- Track token usage from all Gemini model calls
- Update tools to return token usage alongside results
- Fix const reassignment in agent.ts

Co-Authored-By: Han Xiao <han.xiao@jina.ai>
2025-01-31 06:20:45 +00:00
Han Xiao
2aabf4f8e0 chore: first commit 2025-01-27 20:21:08 +08:00
Han Xiao
b5c953d7e4 chore: first commit 2025-01-27 15:59:48 +08:00
Han Xiao
cd35dc7966 chore: first commit 2025-01-27 13:47:13 +08:00