I want to return a json object from my native function but it doesn't returns that. Can anyone guide me how do I achieve that.I would prefer a python solution. The issue with native function in semantic kernel is that it can return only the follwing data types:
def __init__(self,kernel:Kernel) -> None:
self._kernel=kernel
@sk_function(
description="This will load a CSV file and return the string",
name="loadcsv",
input_description="This is a string which is the filename of CSV file",
)
def LoadCSV(self, input: str,kernel:Kernel) -> 'SKContext':
new_context=kernel.create_new_context()
df=pd.read_csv(input["input"])
for col in df.columns:
if df[col].dtype == 'int64' or df[col].dtype == 'float64':
df[col].fillna('', inplace=True)
elif df[col].dtype == 'object' or df[col].dtype == 'datetime64' or df[col].dtype=='category' or df[col].dtype=='bool':
df[col].fillna('', inplace=True)
new_context=df.to_json()
print('new',new_context)
return new_context
I want to return a json object from my native function but it doesn't returns that. Can anyone guide me how do I achieve that.I would prefer a python solution. The issue with native function in semantic kernel is that it can return only the follwing data types:
I want to return a SKContext object as it is not possible currently to return a JSON object . Can anyone help me on this ?
`
class CSVLoader:
`