Collapse model adapter package boundary
This commit is contained in:
parent
b83c041670
commit
a721b76372
14 changed files with 224 additions and 251 deletions
|
|
@ -22,7 +22,7 @@ use epiphany_model_adapter::{
|
|||
MODEL_ADAPTER_EVENT_SCHEMA_ID,
|
||||
};
|
||||
#[cfg(test)]
|
||||
use epiphany_openai_adapter::{EpiphanyOpenRouterRequest, EpiphanyProviderRequestPayload};
|
||||
use epiphany_model_adapter::{EpiphanyOpenRouterRequest, EpiphanyProviderRequestPayload};
|
||||
use epiphany_openai_runtime::DEFAULT_CODEX_CONNECTOR_ENDPOINT;
|
||||
use epiphany_openai_runtime::DEFAULT_PROVIDER_REQUEST_TIMEOUT;
|
||||
use epiphany_openai_runtime::EpiphanyOpenAiRuntimeOptions;
|
||||
|
|
@ -934,7 +934,7 @@ mod tests {
|
|||
output: r#"{"ok":true}"#.into(),
|
||||
});
|
||||
|
||||
let projected = epiphany_openai_adapter::request_from_native(&request)?;
|
||||
let projected = epiphany_model_adapter::request_from_native(&request)?;
|
||||
let EpiphanyProviderRequestPayload::Codex(projected) = projected.payload else {
|
||||
panic!("Codex provider must lower to the connector contract")
|
||||
};
|
||||
|
|
@ -1048,7 +1048,7 @@ mod tests {
|
|||
);
|
||||
request.output_contract_id = Some(format!("worker-schema-{index}"));
|
||||
request.output_schema_json = Some(serde_json::to_string(&schema)?);
|
||||
let projected = epiphany_openai_adapter::strict_provider_schema(
|
||||
let projected = epiphany_model_adapter::strict_provider_schema(
|
||||
request.output_schema_json.as_deref().unwrap(),
|
||||
)?;
|
||||
assert_eq!(projected["additionalProperties"], false);
|
||||
|
|
@ -1072,7 +1072,7 @@ mod tests {
|
|||
),
|
||||
)?);
|
||||
|
||||
let projected = epiphany_openai_adapter::strict_provider_schema(
|
||||
let projected = epiphany_model_adapter::strict_provider_schema(
|
||||
request.output_schema_json.as_deref().unwrap(),
|
||||
)?;
|
||||
let decision = &projected["properties"]["researchDecision"];
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ use epiphany_model_adapter::EpiphanyModelRequest;
|
|||
use epiphany_model_adapter::EpiphanyModelStreamEvent;
|
||||
use epiphany_model_adapter::EpiphanyModelStreamPayload;
|
||||
use epiphany_model_adapter::EpiphanyModelToolDefinition;
|
||||
use epiphany_openai_adapter::EpiphanyProviderRequest;
|
||||
use epiphany_model_adapter::EpiphanyProviderRequest;
|
||||
use epiphany_tool_adapter::EPIPHANY_TOOL_RUNTIME_ADAPTER_ID;
|
||||
use epiphany_tool_adapter::EpiphanyToolInvocationIntent;
|
||||
use epiphany_tool_adapter::EpiphanyToolInvocationReceipt;
|
||||
|
|
@ -765,7 +765,7 @@ pub fn model_receipt_key(request_id: &str) -> String {
|
|||
pub fn provider_request_from_model_request(
|
||||
request: &EpiphanyModelRequest,
|
||||
) -> Result<EpiphanyProviderRequest> {
|
||||
epiphany_openai_adapter::request_from_native(request)
|
||||
epiphany_model_adapter::request_from_native(request)
|
||||
}
|
||||
|
||||
fn repository_source_tools() -> Vec<EpiphanyModelToolDefinition> {
|
||||
|
|
@ -2772,7 +2772,7 @@ mod tests {
|
|||
"gpt-5.4",
|
||||
"Answer plainly.",
|
||||
);
|
||||
let request = epiphany_openai_adapter::request_from_native(&native_request)?;
|
||||
let request = epiphany_model_adapter::request_from_native(&native_request)?;
|
||||
let options = default_options(store.clone(), &request);
|
||||
ensure_openai_runtime_ready(&options)?;
|
||||
open_runtime_model_execution(
|
||||
|
|
@ -3220,7 +3220,7 @@ mod tests {
|
|||
r#"{"type":"object","properties":{"researchDecision":{"type":"string"}},"required":["researchDecision"]}"#
|
||||
.to_string(),
|
||||
);
|
||||
let request = epiphany_openai_adapter::request_from_native(&native_request)?;
|
||||
let request = epiphany_model_adapter::request_from_native(&native_request)?;
|
||||
let options = default_options(store.clone(), &request);
|
||||
ensure_openai_runtime_ready(&options)?;
|
||||
open_runtime_model_execution(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use epiphany_model_adapter::{
|
|||
EpiphanyModelReceipt, EpiphanyModelRequest, EpiphanyModelStreamEvent,
|
||||
EpiphanyModelStreamPayload, MODEL_ADAPTER_EVENT_SCHEMA_ID,
|
||||
};
|
||||
use epiphany_openai_adapter::{
|
||||
use epiphany_model_adapter::{
|
||||
EpiphanyOpenRouterRequest, EpiphanyProviderRequestPayload, openrouter_events_from_response,
|
||||
openrouter_request_body,
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue