mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Compare commits
4 Commits
b50dacec00
...
dc92d7abc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc92d7abc1 | ||
|
|
78c59f4f28 | ||
|
|
de5c77407d | ||
|
|
30101cf1f0 |
@ -30,6 +30,7 @@ from .types import (
|
|||||||
ToolChoice,
|
ToolChoice,
|
||||||
)
|
)
|
||||||
from .types.exceptions import get_user_friendly_error_message
|
from .types.exceptions import get_user_friendly_error_message
|
||||||
|
from .types.models import GeminiGoogleSearch
|
||||||
from .utils import create_multimodal_message
|
from .utils import create_multimodal_message
|
||||||
|
|
||||||
T = TypeVar("T", bound=BaseModel)
|
T = TypeVar("T", bound=BaseModel)
|
||||||
@ -182,7 +183,7 @@ async def embed_documents(
|
|||||||
|
|
||||||
|
|
||||||
async def generate_structured(
|
async def generate_structured(
|
||||||
message: str | LLMMessage | list[LLMContentPart],
|
message: str | UniMessage | LLMMessage | list[LLMContentPart],
|
||||||
response_model: type[T],
|
response_model: type[T],
|
||||||
*,
|
*,
|
||||||
model: ModelName = None,
|
model: ModelName = None,
|
||||||
@ -402,4 +403,5 @@ async def search(
|
|||||||
model=model,
|
model=model,
|
||||||
instruction=instruction,
|
instruction=instruction,
|
||||||
config=final_config,
|
config=final_config,
|
||||||
|
tools=[GeminiGoogleSearch()],
|
||||||
)
|
)
|
||||||
|
|||||||
@ -445,11 +445,12 @@ class AI:
|
|||||||
instruction=instruction,
|
instruction=instruction,
|
||||||
template_vars=template_vars,
|
template_vars=template_vars,
|
||||||
config=search_config,
|
config=search_config,
|
||||||
|
tools=[GeminiGoogleSearch()],
|
||||||
)
|
)
|
||||||
|
|
||||||
async def generate_structured(
|
async def generate_structured(
|
||||||
self,
|
self,
|
||||||
message: str | LLMMessage | list[LLMContentPart] | None,
|
message: str | UniMessage | LLMMessage | list[LLMContentPart] | None,
|
||||||
response_model: type[T],
|
response_model: type[T],
|
||||||
*,
|
*,
|
||||||
model: ModelName = None,
|
model: ModelName = None,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user