21 Commits

Author SHA1 Message Date
Han Xiao
d44cec6524 fix: improve json parsing resilience and disable gemini thinking
- add jsonrepair fallback for truncated LLM output
- disable gemini built-in thinking mode (thinkingBudget: 0)
- increase token limits for errorAnalyzer, queryRewriter, serpCluster
- switch production default to gemini-2.5-flash-lite
- fix normalizeHostName to handle wildcard patterns
2025-12-13 12:07:37 +01:00
Sha Zhou
22be63abe1 validate request body 2025-06-13 15:15:01 +08:00
Sha Zhou
df7bfc72c5
fix oom issue (#114) 2025-06-12 10:01:03 +08:00
Sha Zhou
609687aaeb remove save image function 2025-06-10 17:40:35 +08:00
Sha Zhou
a768755783
feat: gather images to response (#98)
* feat: add image tools

* rank images

* add image dedup

* wip

* wip

* remove rank functions

* fix

* add embeddings to image

* move image object to agent

* build image references

* update

* add with_images param

* update dimensions for image tools

* dudup images

* save images to cloud storage

* remove extra log

* fix

* remove test data

* fix
2025-06-10 11:55:46 +08:00
Han Xiao
25606299ba fix: md table render 2025-03-20 14:15:14 +08:00
Han Xiao
b0c07162dd fix: strict evaluator 2025-03-14 11:57:02 +08:00
Han Xiao
7c035f59c5 feat: add json schema support 2025-03-03 10:51:03 +08:00
Yanlong Wang
44530a4760
llm-provider: google cloud vertex 2025-02-12 18:53:07 +08:00
Han Xiao
441654ac5d feat: improve prompting 2025-02-10 12:10:46 +08:00
devin-ai-integration[bot]
39579d560e
feat: add OpenAI-compatible chat completions endpoint (#48) 2025-02-09 09:25:01 +08:00
ARNO
eca4df218c
fix dependencies (#31) 2025-02-06 21:40:05 +08:00
devin-ai-integration[bot]
282de3f245
feat: add npm publish workflow (#29)
* feat: add npm publish workflow

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

* feat: add CLI interface

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

* fix: add moduleResolution and resolveJsonModule to tsconfig

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

* feat: add OPENAI_API_KEY to workflow files

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-06 16:34:39 +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
devin-ai-integration[bot]
76f8cd242a
feat: merge types and add tests (#10)
* feat: merge types and add tests

- Merged types.ts and tracker.ts
- Added Jest configuration and setup
- Added comprehensive tests for tools and agent
- Updated package.json with test scripts

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

* chore: remove tracker.ts after merging into types.ts

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

* fix: remove sensitive API keys from jest.setup.js

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

* fix: improve error handling and test timeouts

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

* feat: add token budget enforcement to TokenTracker

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

* feat: add github actions workflow for CI and fix remaining issues

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-03 18:01:59 +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]
b48f7afb6d
feat: add Brave Search integration (#4)
* feat: add Brave Search integration

- Add Brave Search implementation
- Configure Brave API key in config
- Make search provider configurable with Brave as default

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

* chore: first commit

---------

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 18:24:45 +08:00
Han Xiao
cd35dc7966 chore: first commit 2025-01-27 13:47:13 +08:00
Han Xiao
1291e23cef chore: first commit 2025-01-26 15:26:46 +08:00
Han Xiao
5eb75fcb61 chore: first commit 2025-01-26 14:53:55 +08:00