Skip to content
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

Add nested test cases for data_struct with structs and vectors #3191

Merged
merged 1 commit into from
Jan 15, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 1-86:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x2.table;
import 0x1.option;

struct Media has store, copy, drop {
id: string.String,
url: string.String,
title: string.String,
source: string.String,
description: string.String,
text: string.String,
contentType: string.String,
}

struct Content has store, copy, drop {
text: string.String,
action: option.Option<string.String>,
source: option.Option<string.String>,
url: option.Option<string.String>,
inReplyTo: option.Option<string.String>,
attachments: vector<Self.Media>,
}

struct Memory has store, copy, drop {
id: string.String,
userId: string.String,
agentId: string.String,
createdAt: option.Option<u64>,
content: Self.Content,
character: string.String,
embedding: vector<u128>,
roomId: string.String,
unique: bool,
similarity: option.Option<u128>,
}

struct MessageTemplate has store, copy, drop{
user: string.String,
content: Self.Content,
}

struct MemoryStore has key {
agent_account: address,
store: table.Table<string.String, Self.Memory>,
}

struct Style has store, copy, drop {
all: vector<string.String>,
chat: vector<string.String>,
post: vector<string.String>,
}

struct Character has key {
/// Optional UUID for the character.
id: option.Option<string.String>,
name: string.String,
username: string.String,
plugins: vector<string.String>,
clients: vector<string.String>,
modelProvider: string.String,
imageModelProvider: option.Option<string.String>,
imageVisionModelProvider: option.Option<string.String>,
modelEndpointOverride: option.Option<string.String>,
system: string.String,
bio: vector<string.String>,
lore: vector<string.String>,
messageExamples: vector<vector<Self.MessageTemplate>>,
postExamples: vector<string.String>,
topics: vector<string.String>,
style: Self.Style,
adjectives: vector<string.String>,
knowledge: vector<string.String>,
}

metadata {
data_struct {
0x11::TestModule1::Media -> true;
0x11::TestModule1::Content -> true;
0x11::TestModule1::Memory -> true;
0x11::TestModule1::Style -> true;
0x11::TestModule1::MessageTemplate -> true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 1-51:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x2.table;
import 0x1.option;

struct Media has store, copy, drop {
id: string.String,
url: string.String,
title: string.String,
source: string.String,
description: string.String,
text: string.String,
contentType: string.String,
}

struct Content has store, copy, drop {
text: string.String,
action: option.Option<string.String>,
source: option.Option<string.String>,
url: option.Option<string.String>,
inReplyTo: option.Option<string.String>,
attachments: vector<Self.Media>,
}

struct Memory has store, copy, drop {
id: string.String,
userId: string.String,
agentId: string.String,
createdAt: option.Option<u64>,
content: Self.Content,
character: string.String,
embedding: vector<u128>,
roomId: string.String,
unique: bool,
similarity: option.Option<u128>,
}

struct MemoryStore has key {
agent_account: address,
store: table.Table<string.String, Self.Memory>,
}

metadata {
data_struct {
0x11::TestModule1::Media -> true;
0x11::TestModule1::Content -> true;
0x11::TestModule1::Memory -> true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 1-67:
status EXECUTED
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//# publish
module 0x11.TestModule1 {
import 0x1.string;
import 0x2.table;
import 0x1.option;

struct Style has store, copy, drop {
all: vector<string.String>,
chat: vector<string.String>,
post: vector<string.String>,
}

struct Media has store, copy, drop {
id: string.String,
url: string.String,
title: string.String,
source: string.String,
description: string.String,
text: string.String,
contentType: string.String,
}

struct Content has store, copy, drop {
text: string.String,
action: option.Option<string.String>,
source: option.Option<string.String>,
url: option.Option<string.String>,
inReplyTo: option.Option<string.String>,
attachments: vector<Self.Media>,
}

struct MessageTemplate has store, copy, drop{
user: string.String,
content: Self.Content,
}

struct Character has key {
/// Optional UUID for the character.
id: option.Option<string.String>,
name: string.String,
username: string.String,
plugins: vector<string.String>,
clients: vector<string.String>,
modelProvider: string.String,
imageModelProvider: option.Option<string.String>,
imageVisionModelProvider: option.Option<string.String>,
modelEndpointOverride: option.Option<string.String>,
system: string.String,
bio: vector<string.String>,
lore: vector<string.String>,
messageExamples: vector<vector<Self.MessageTemplate>>,
postExamples: vector<string.String>,
topics: vector<string.String>,
style: Self.Style,
adjectives: vector<string.String>,
knowledge: vector<string.String>,
}

metadata {
data_struct {
0x11::TestModule1::Style -> true;
0x11::TestModule1::Content -> true;
0x11::TestModule1::Media -> true;
0x11::TestModule1::MessageTemplate -> true;
}
}
}
Loading