Skip to content

Commit

Permalink
not sur3e whats ehre
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk committed Nov 6, 2023
1 parent d82c58a commit 44a4d8a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chatlab/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
import asyncio
import logging
import os
from typing import AsyncIterator, Callable, List, Optional, Tuple, Type, Union, overload
from typing import (AsyncIterator, Callable, List, Optional, Tuple, Type,
Union, overload)

import openai
from deprecation import deprecated
from IPython.core.async_helpers import get_asyncio_loop
from openai import AsyncOpenAI
from openai.types.chat import ChatCompletion, ChatCompletionChunk, ChatCompletionMessageParam
from openai.types.chat import (ChatCompletion, ChatCompletionChunk,
ChatCompletionMessageParam)
from pydantic import BaseModel

from chatlab.views.assistant_function_call import AssistantFunctionCallView
Expand All @@ -29,7 +31,8 @@
from .display import ChatFunctionCall
from .errors import ChatLabError
from .messaging import human
from .registry import FunctionRegistry, FunctionSchema, PythonHallucinationFunction
from .registry import (FunctionRegistry, FunctionSchema,
PythonHallucinationFunction)
from .views.assistant import AssistantMessageView

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -206,6 +209,7 @@ async def __process_full_completion(self, resp: ChatCompletion) -> Tuple[str, Op

return choice.finish_reason, function_view


async def submit(self, *messages: Union[ChatCompletionMessageParam, str], stream=True, **kwargs):
"""Send messages to the chat model and display the response.
Expand Down

0 comments on commit 44a4d8a

Please sign in to comment.