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

fix: avoid OpenAILikeEmbedding always use zhipu api url when knowledge graph building #579

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

Mini256
Copy link
Member

@Mini256 Mini256 commented Jan 8, 2025

When using OpenAILikeEmbedding, if a provider other than zhipu is configured, an authentication information error will appear when building knowledge graph.

[2025-01-08 03:10:38,501: INFO/ForkPoolWorker-2] HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 401 Unauthorized"
[2025-01-08 03:10:38,507: ERROR/ForkPoolWorker-2] app.tasks.build_index.build_kg_index_for_chunk[4489bfc3-0e7c-4606-ad77-b973ef24a3f1]: Failed to build knowledge graph index for chunk #60564d4d-1522-476c-9660-ab1859ee2b1e
Traceback (most recent call last):
  File "/app/app/tasks/build_index.py", line 125, in build_kg_index_for_chunk
    index_service.build_kg_index_for_chunk(index_session, db_chunk)

This bug is due to config.pop()call will remove the api_base param from the config, and using the zhipu api_base by default.

In the method of get_embed_model / get_llm / get_reranker_model, the config should be inmutable.

@Mini256 Mini256 requested a review from wd0517 January 8, 2025 05:28
Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tidb-ai-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 5:29am
tidb-ai-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 5:29am

Copy link

github-actions bot commented Jan 8, 2025

@Mini256 Mini256 changed the title fix: fix get embed model bug fix: avoid OpenAILikeEmbedding always use zhipu api url when knowledge graph building Jan 8, 2025
@Mini256 Mini256 merged commit 3d47ddf into main Jan 8, 2025
14 checks passed
@Mini256 Mini256 deleted the fix-get-model-bug branch January 8, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant