Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/agent_knowledge_pg_rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import psycopg
from openai import OpenAI
from pgvector.psycopg import register_vector
from pgvector import Vector

from agent_framework import Agent, AgentSession, BaseContextProvider, Message, SessionContext, SupportsAgentRun
from agent_framework.openai import OpenAIChatClient
Expand Down Expand Up @@ -305,7 +306,7 @@ async def _rewrite_query(self, conversation_messages: list[Message]) -> str:

def _search(self, query: str) -> list[dict]:
"""Run hybrid search (vector + full-text) and return matching products."""
query_embedding = get_embedding(query)
query_embedding = Vector(get_embedding(query))

cursor = self.conn.execute(
HYBRID_SEARCH_SQL,
Expand Down
3 changes: 2 additions & 1 deletion examples/agent_knowledge_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import psycopg
from openai import OpenAI
from pgvector.psycopg import register_vector
from pgvector import Vector

from agent_framework import Agent, AgentSession, BaseContextProvider, Message, SessionContext, SupportsAgentRun
from agent_framework.openai import OpenAIChatClient
Expand Down Expand Up @@ -257,7 +258,7 @@ def __init__(self, conn: psycopg.Connection, max_results: int = 3):

def _search(self, query: str) -> list[dict]:
"""Run hybrid search (vector + full-text) and return matching products."""
query_embedding = get_embedding(query)
query_embedding = Vector(get_embedding(query))

cursor = self.conn.execute(
HYBRID_SEARCH_SQL,
Expand Down