Skip to content

Commit

Permalink
use asyncio_run
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich committed Dec 23, 2024
1 parent c380264 commit ada5dec
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import uuid
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional, Union, cast
import asyncio
from llama_index.core.bridge.pydantic import PrivateAttr

from llama_index.core.async_utils import asyncio_run
from llama_index.core.bridge.pydantic import PrivateAttr
from llama_index.core.schema import BaseNode, MetadataMode, TextNode
from llama_index.core.vector_stores.types import (
FilterCondition,
Expand Down Expand Up @@ -131,14 +131,14 @@ def __init__(
except TypeError:
# Probably using async so switch to async client
try:
asyncio.run(self._os_async_client.indices.get(index=self._index))
asyncio_run(self._os_async_client.indices.get(index=self._index))
except not_found_error:
asyncio.run(
asyncio_run(
self._os_async_client.indices.create(
index=self._index, body=idx_conf
)
)
asyncio.run(self._os_async_client.indices.refresh(index=self._index))
asyncio_run(self._os_async_client.indices.refresh(index=self._index))
except not_found_error:
self._os_client.indices.create(index=self._index, body=idx_conf)
self._os_client.indices.refresh(index=self._index)
Expand Down

0 comments on commit ada5dec

Please sign in to comment.