-
Notifications
You must be signed in to change notification settings - Fork 328
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
ell serialization refactor / distributed 2 #362
base: main
Are you sure you want to change the base?
Conversation
Subscriber = WebSocket | ||
|
||
|
||
class PubSub(ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs documented
|
||
MAX_TOPIC_LENGTH = 65535 | ||
|
||
class TopicMatcher: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document
app = FastAPI( | ||
title="ell api", | ||
description="ell api server", | ||
version="0.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ell version
|
||
|
||
# Load the image using PIL | ||
big_picture = Image.open(os.path.join(os.path.dirname(__file__), "bigpicture.jpg")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe download the big picture instead of keeping in repo
@@ -97,7 +97,7 @@ def wrapper( | |||
|
|||
# Determine the type annotation | |||
if param.annotation == inspect.Parameter.empty: | |||
raise ValueError(f"Parameter {param_name} has no type annotation, and cannot be converted into a tool schema for OpenAI and other provisders. Should OpenAI produce a string or an integer, etc, for this parameter?") | |||
raise ValueError(f"Parameter {param_name} has no type annotation, and cannot be converted into a tool schema for OpenAI and other providers. Should OpenAI produce a string or an integer, etc, for this parameter?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like
raise ValueError(f"Parameter {param_name} has no type annotation, and cannot be converted into a tool schema for OpenAI and other providers. Should OpenAI produce a string or an integer, etc, for this parameter?") | |
raise ValueError(f"The {tool_name} tool parameter {param_name} needs a type annotation. | |
Example: | |
def {tool_name}({param_name}: str): | |
^^^ Add the type of {param_name} here | |
Tool function annotations help ell create a tool schema for OpenAI and other providers.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last line of the error message should be: More info: https://docs.ell.so/core_concepts/tool_usage.html#defining-tools
@@ -1,6 +1,9 @@ | |||
from abc import ABC, abstractmethod | |||
from collections import defaultdict | |||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, cast | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed
# """Serializes ell objects to json for writing to the database or wire protocols""" | ||
# return json.dumps( | ||
# pydantic_ltype_aware_cattr.unstructure(obj), | ||
# sort_keys=True, default=repr, ensure_ascii=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address this…will had a comment about serialize_object elsewhere
from typing import Any | ||
import ell.types.serialize | ||
|
||
def utc_now() -> datetime: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See if this lives elsewhere and maybe name current_timestamp or something less awkward
Rough overview: