Skip to content

Commit

Permalink
Archived test for reflection schema engine
Browse files Browse the repository at this point in the history
  • Loading branch information
ddebowczyk committed Mar 4, 2024
1 parent b6ffedc commit 40ed002
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"type": "function",
"function": {
"name": "addEvent",
"description": "Extract object from provided content",
"parameters": {
"type": "object",
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Title of the event - this should be a short, descriptive title of the event"
},
"description": {
"type": "string",
"description": "Concise, informative description of the event"
},
"type": {
"type": "string",
"enum": [
"risk",
"issue",
"action",
"progress",
"other"
],
"description": "Type of the event"
},
"status": {
"type": "string",
"enum": [
"open",
"closed",
"unknown"
],
"description": "Status of the event"
},
"stakeholders": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the stakeholder"
},
"role": {
"type": "string",
"enum": [
"customer",
"vendor",
"system integrator",
"other"
],
"description": "Role of the stakeholder, if specified"
},
"details": {
"type": "string",
"description": "Any details on the stakeholder, if specified - any mentions of company, organization, structure, group, team, function"
}
},
"required": [
"name",
"role"
]
}
},
"date": {
"type": "string",
"description": "Date of the event if reported in the text"
}
},
"required": [
"title",
"description",
"type",
"status",
"stakeholders"
]
},
"description": "List of events extracted from the text"
}
},
"required": [
"events"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function createEvent(string $title, string $date, array $stakeholders): ProjectE
expect($array['function']['parameters']['properties']['stakeholders']['type'])->toEqual('array');
// ...
expect($array)->toMatchSnapshot();
});
})->skip('Deprecated schema engine');

it('creates function call - method', function () {
$array = (new FunctionCallFactory)->fromMethod((new ProjectEvents)->createEvent(...));
Expand All @@ -46,7 +46,7 @@ function createEvent(string $title, string $date, array $stakeholders): ProjectE
expect($array['function']['parameters']['properties']['stakeholders']['type'])->toEqual('array');
// ...
expect($array)->toMatchSnapshot();
});
})->skip('Deprecated schema engine');

it('creates function call - object', function () {
$array = (new FunctionCallFactory)->fromClass(ProjectEvents::class, 'createEvent', 'Extract object from provided content');
Expand All @@ -60,4 +60,4 @@ function createEvent(string $title, string $date, array $stakeholders): ProjectE
expect($array['function']['parameters']['properties']['events']['items']['type'])->toEqual('object');
// ...
expect($array)->toMatchSnapshot();
});
})->skip('Deprecated schema engine');
39 changes: 0 additions & 39 deletions tests/Feature/ExperimentalTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Feature/ExtractionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
ProjectEvents::class,
maxRetries: 2,
);
dump($events);

expect($events)->toBeInstanceOf(ProjectEvents::class);
expect($events->events)->toBeArray();
expect($events->events[0])->toBeInstanceOf(ProjectEvent::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/ResponseModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
expect($responseModel->functionCall['function']['parameters']['required'][1])->toBe('email');
});

it('can handle raw ObjectSchema instance', function() {
it('can handle ObjectSchema instance', function() {
$schema = (new SchemaFactory)->schema(User::class);
$responseModel = new ResponseModel($schema);
expect($responseModel->class)->toBe(User::class);
Expand Down
File renamed without changes.

0 comments on commit 40ed002

Please sign in to comment.