ell serialization refactor / distributed 2#362
Draft
alex-dixon wants to merge 45 commits intoMadcowD:mainfrom
Draft
ell serialization refactor / distributed 2#362alex-dixon wants to merge 45 commits intoMadcowD:mainfrom
alex-dixon wants to merge 45 commits intoMadcowD:mainfrom
Conversation
alex-dixon
commented
Nov 19, 2024
| Subscriber = WebSocket | ||
|
|
||
|
|
||
| class PubSub(ABC): |
Contributor
Author
There was a problem hiding this comment.
Needs documented
|
|
||
| MAX_TOPIC_LENGTH = 65535 | ||
|
|
||
| class TopicMatcher: |
| app = FastAPI( | ||
| title="ell api", | ||
| description="ell api server", | ||
| version="0.1.0", |
Contributor
Author
There was a problem hiding this comment.
Should be ell version
|
|
||
|
|
||
| # Load the image using PIL | ||
| big_picture = Image.open(os.path.join(os.path.dirname(__file__), "bigpicture.jpg")) |
Contributor
Author
There was a problem hiding this comment.
Maybe download the big picture instead of keeping in repo
alex-dixon
commented
Nov 19, 2024
| # 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?") |
Contributor
Author
There was a problem hiding this comment.
Something like
Suggested change
| 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.") |
Contributor
Author
There was a problem hiding this comment.
Last line of the error message should be: More info: https://docs.ell.so/core_concepts/tool_usage.html#defining-tools
alex-dixon
commented
Nov 19, 2024
| from abc import ABC, abstractmethod | ||
| from collections import defaultdict | ||
| from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, cast | ||
|
|
alex-dixon
commented
Nov 19, 2024
alex-dixon
commented
Nov 19, 2024
alex-dixon
commented
Nov 20, 2024
| # """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) |
Contributor
Author
There was a problem hiding this comment.
Address this…will had a comment about serialize_object elsewhere
alex-dixon
commented
Nov 20, 2024
| from typing import Any | ||
| import ell.types.serialize | ||
|
|
||
| def utc_now() -> datetime: |
Contributor
Author
There was a problem hiding this comment.
See if this lives elsewhere and maybe name current_timestamp or something less awkward
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rough overview: