Skip to content
Open
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
32 changes: 5 additions & 27 deletions src/agentics/core/atype.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import csv
import datetime
import html
import io
import json
import types
import os
from typing import (
Annotated,
IO,
Any,
Dict,
List,
Literal,
Mapping,
Optional,
Sequence,
Set,
Tuple,
Type,
Expand All @@ -21,6 +19,7 @@

import pandas as pd
from pydantic import BaseModel, Field, create_model
from pydantic._internal._model_construction import ModelMetaclass

from agentics.core.utils import sanitize_dict_keys, sanitize_field_name

Expand All @@ -46,12 +45,6 @@ def copy_attribute_values(
return state


from typing import Type

import pandas as pd
from pydantic import BaseModel


def get_pydantic_fields(atype: Type[BaseModel]):
"""
Extract Pydantic model fields and return them in the same
Expand Down Expand Up @@ -103,11 +96,6 @@ def get_active_fields(state: BaseModel, allowed_fields: Set[str] = None) -> Set[
return active_fields & allowed_fields if allowed_fields else active_fields


import io
import os
from typing import IO


def pydantic_model_from_csv(
file_source: Union[str, os.PathLike, IO[str], IO[bytes], object],
) -> type[BaseModel]:
Expand Down Expand Up @@ -467,9 +455,6 @@ def _base_normalize(s: str) -> str:
return (_base_normalize(s), False)


import html


def pydantic_to_markdown(obj: BaseModel, title: str | None = None) -> str:
"""
Pretty-print a Pydantic model instance as a Markdown table,
Expand Down Expand Up @@ -500,10 +485,6 @@ def pydantic_to_markdown(obj: BaseModel, title: str | None = None) -> str:
return "\n".join(lines)


from pydantic import BaseModel, create_model
from pydantic._internal._model_construction import ModelMetaclass


def _check_compatibility(A, B):
"""
Returns True if A and B have no conflicting field annotations.
Expand Down Expand Up @@ -718,9 +699,6 @@ def project_as_superclass(Model: type[BaseModel], selected_fields):
return Projected


from pydantic import BaseModel, create_model


def project_as_superclass(Model: type[BaseModel], selected_fields):
if isinstance(selected_fields, str):
selected_fields = [selected_fields]
Expand Down
Loading